• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by g5154 · Feb 01, 2014 at 04:17 AM · collisionphysicsrigidbodybouncing

Ball falls through the floor... why?

I have a scene where there is a box and a ball inside it, both have rigid bodies and physic materials. The ball is launched inside the box at a random angle and speed, so the ball bounces around until it finally stops. Everything works fine... but not always. Sometimes the ball falls through the floor o passes through the walls... the problem seemed to be solved when I increased the mass of the box to 1000k but after some more testing it was clear that such change didn't solve anything...

Inside the box there is also an object with an script that modifies the speed and direction of the ball when it gets hit, but the problem doesn't seem to happen immediately after the ball hits this object... I'm not quite sure but it seems like the ball become invisible to the collision system immediately after hitting the ceiling... but again... not always.

I'm new to Unity so maybe I'm missing something... but I just can't figure out what... can anyone help?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Feb 01, 2014 at 04:20 AM 1
Share

Having object not go through colliders is a common question on UA. There is no single solution. Google searches will turn out many answers along with explanations of why the problem occurs. The single answer that seems to have the most impact is to:

Edit > Project Settings > Time

...and reduce Fixed Timestep from 0.02 to 0.01.

avatar image Manco Capac · Feb 01, 2014 at 06:38 AM 0
Share

check for code errors as well. sometimes errors in other scripts make frame rate low, or mess with physics.

avatar image Manco Capac · Feb 01, 2014 at 08:53 AM 0
Share

and also change collider (collision detection) settings to continuous.

avatar image g5154 · Feb 03, 2014 at 04:20 PM 0
Share

It seems robertbu is right, by reducing the Fixed Timestep to 0.01 the problem seem to be solved, I still need to do more testing, but until now hasn't happened again. Thanks!!!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bloodyem · Feb 01, 2014 at 08:38 AM

How fast is the ball moving? If it's moving too quickly, it could pass through the walls and floor without actually hitting the colliders. Check the speed it's moving when it slips through, and possibly increase the solver, sometimes that'll help.

Edit>Project Settings>Physics>Solver Iteration Count

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image g5154 · Feb 03, 2014 at 04:09 PM 0
Share

Ok, it makes sense, the distance between the floor and the ceiling is a bit long, so when the ball hits the ceiling and falls close to a straight angle it gains a lot of speed...

Well... I increased "Solver Interaction Count" from the default (6) to 12 and nothing seems to happen, I increased it to the maximum (100) and when the ball falls straight from the ceiling it doesn't pass through the floor, however in the rebound it does... so there must be something else.

I tried the solution described by robertbu and it seems like "Fixed Timestep" has a more powerful impact in the collision detection system.

Thanks for the tip, it was useful anyway.

avatar image Bloodyem · Feb 03, 2014 at 04:15 PM 0
Share

It does what, exactly? Its supposed to bounce, correct? Where is it going once it has bounced on the floor, or however it's rebounding?

avatar image g5154 · Feb 03, 2014 at 04:40 PM 0
Share

The ball bounces correctly on the floor, but it does not collide with the floor for a second time, ins$$anonymous$$d it passes through just as if the floor wasn't there, which is curious since it looses a lot of speed after the first collision. I restored "Solver Interaction Count" to it's default (6) and reduced "Fixed Timestep" (in Edit->Project Settings->Time) to 0.01 and the problem seems to be solved... I need to do more testing but for now it seems solved.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Sphere / Box collision causes jitter 0 Answers

Physics - increase gravity speed without making balls fall through planes 1 Answer

Collision interpenetration and object getting stuck 1 Answer

Knock down moving target ridigbody from collision. 1 Answer

How do I "remove/disable" collision? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges