- Home /
Fast moving object not detect collision
Hello,
I am having an issue with collision detecting. My marble sometimes fall under the map, when falling at a higher speed. I am using mesh colliders, because the map elements are blended, so they cant use primitive colliders.
Is there any way to fix this, or reduce the risk of falling over?
Answer by Chris D · Jul 29, 2011 at 03:34 PM
Try DontGoThroughThings.
I have tried it, but it is still happening (however, rarer).
I have added the correct layer masks, and increased the skin width. It looks like it is good now. Thank you :)
kindly can you tell me that what is layer mask and how can i add it in inspector???
Hi everyone..! for all those who are suffering from this prob. When we apply the script on any object from the DontGoThroughThing , in inspecter change the layer mask to everything.... it worked for me ... :')
Answer by Eric5h5 · Jul 29, 2011 at 03:26 PM
Use continuous collision detection instead of discrete collision detection.
There is only one problem with that: continuous collision detection can't be used with mesh colliders. Any other suggestion?
@Dreeka: continuous collision detection works with mesh colliders just fine. Which is to say, the continuous detection should be on the marble, not the mesh collider (which shouldn't have a rigidbody anyway). It would be better to use continuous collision rather than raycasting, because it works with the entire sphere collider, not just a raycast line.
Answer by Doddler · Jul 29, 2011 at 03:44 PM
In a worst case, you could manually handle the detection by casting a ray from the marbles old position to the new position and finding any points where it intersects. This should catch all but edge cases where the object would travel just past the edge of the mesh. That wouldn't really give you any physics reaction but it would let you catch cases where it falls when it shouldn't.
Your answer
Follow this Question
Related Questions
Rigidbodies won't collide if mass difference is too high 0 Answers
Rigidbody.MovePosition/MoveRotation Hits far away colliders 2 Answers
Is there a solution to when colliders bypass? 2 Answers
CharacterController jumps when colliding with kinematic rigidbodies 1 Answer
OnCollisionEnter isnt called when player lands on object 1 Answer