- Home /
fast collision between a mesh collider and a continuous dynamic rigidbody
My main object is very fast, and it's been going through my mesh colliders as if they didn't exist. I've been trying out Unity 3.0's collision detection options hoping that it will solve the problem.
But it seems like these options only apply for rigidbodies, and reading from:
Continuous - Used for objects which the Continuous Dynamic detection needs to collide with. Continuous Dynamic - Used for fast moving objects.
it seems as if I don't set one object on continuous
and the other on continuous dynamic
, it won't affect my collisions.
I have two questions:
- Should I still set my main rigidbody in
continuous
mode even though it will collide with a mesh collider? - And is there anyway to give make my mesh the
continuous
property?
Answer by jonas-echterhoff · Jul 30, 2010 at 10:53 AM
If your fast moving object has a rigidbody (it should), and you set that to "continuous dynamic", you should be fine for any collisions against:
-static mesh colliders.
-other rigidbodies with continuous collision detection enabled.
In other words, you don't need rigidbodies on the static meshes for CCD to work. You will need to add rigidbodies to primitive colliders, though.
@jonas echterhoff: That sounds good, but Unity Docs say a completely different thing -that is what did lead me to find this question. I quote:
Continuous Collision Detection is only supported for Rigidbodies with Sphere-, Capusle- or BoxColliders.
Anyway, I will try it out as you say, just in case the Docs are wrong/outdated (it might be).
@jonas echterhoff: After doing several stress tests against a mesh collider, I conclude that what you say is correct, regardless of what is written in the docs.
@jonas echterhoff: I recently started trying with a fast moving object that, this time, also rotates at very high speed. Somehow, with high angular speed the "stopping force" of the moving object increases, thus the moving object runs through the mesh collider too easily compared with low rotation tests.
Perhaps Unity Developers didn't have this situation in $$anonymous$$d, or perhaps it was very difficult to correct with angles changing too rapidly.
PD: However, the same test against a primitive "Cuboid" form with a similar thickness than the custom mesh form, couldn't be "pierced" with same linear and angular speed (and I tried agressively)
Your answer
Follow this Question
Related Questions
Is there ANY possible way to use a mesh collider(without convex) with a rigidbody? 1 Answer
Stop rigidbody from moving after it falls on another rigidbody 1 Answer
Anyway to make my object not fall through the floor without convex? 0 Answers
My character falls over when colliding 1 Answer
Problem with collision - Collision.other.gameObject is obsolete 1 Answer