- Home /
collision not working at high speeds
i have 2 cars in my scene, yet, when both are moving, sometimes the collision is ignored, and i can drive straight through the other car! How do i fix this?
Get unity 3. It has an option for continuous collision detection that prevents fast objects from passing through things
this sounds best. Thanks, i'll wait till that comes out :).
Answer by 3dDude · Aug 27, 2010 at 12:47 AM
check out this script on the wiki
and meshColliders don't work as well on heigh speeds collisions as a boxCollider would.
so try using box colliders if you are using meshCollider
@Fishmasn92: The script 3dDude linked to is quite simple, useful and reliable in catching problems like yours. It's definitely worth trying while waiting for unity3 ;-)
Answer by tylo · Aug 27, 2010 at 10:02 PM
You may want to look into using Raycasts as another form of collision detection. May not be the solution, but I'm just trying to give you some options.
http://unity3dstudent.com/2010/08/intermediate-i01-raycasting/
I believe what is happening is that you're moving so fast, that you are skipping right through the object before it has a chance of doing any detection. This is a common problem in game design, so see if you can't find someone who talks about it online through google.
Answer by tylo · Aug 27, 2010 at 04:12 AM
Be sure to do your physics in the FixedUpdate method as well, if you are not already.