- Home /
Problems with fast moving colliders
Hi , I have sphere in the scene which moves around, if it hits with any object it reflects properly I'm using OnTriggerEnter. Now my question is, if the speed of the sphere is fast it does not detect the collision, how can i fix it?
You should probably consider writing a proper subject and proper question. That will help you get this answered. You should be able to edit your question - so, the subject should just be a very short statement outlining what your question is about, and the body should contain all the details of the question ;-)
Answer by StephanK · Jun 23, 2010 at 11:22 AM
To fix this you can either increase the size of the colliders, or if that is not an option you could decrease Fixed Timestep (Edit->project settings->time). This will make the physics engine do more updates, so the chances that it misses a collision get smaller. However this will also decrease the overall performance of your game, so you have to think about how often you can update physics without hurting your framerate too much.
Answer by jonas-echterhoff · Jun 23, 2010 at 01:07 PM
What spree wrote is correct. In addition to that, you have two other options:
You can implement a backup solution using ray casts - in FixedUpdate, cast a ray from the previous position of the collider to the current position, and see if it has passed through anything. If it did, move it back, and slow down the velocity.
You can wait for Unity 3, which will have a continuous collision detection feature to solve exactly this problem.
while there is no certain launch date yet, we have just begun shipping pre-release builds to pre-order customers, so it cannot be far away.
Your answer
Follow this Question
Related Questions
Moving object breaks physics 3 Answers
Fast moving object not detect collision 3 Answers
Imported 3D models collisions 1 Answer
FPS Tutorial: Why do my grenades go through the walls? 3 Answers