I have a missile object with a capsule collider. When I shoot the missile off, sometimes (about 50%) it will bounce off the mesh it collides with, instead of exploding. In my OnCollisionEnter method (on the Missile) I can see that the OnCollisionEnter method is not called - but surely if it bounces off the collision must be detected?
I had a similar issue with a prefab with more than one collider (on parent and child), where how the object hits another collider depends on which gets activated (only one had a scripted effect). But in this case I have only one collider, so this cannot be the issue.
Does any one have any idea what is going on, or how I could track down the cause?
Edit More info: I have continuous dynamics switched on on the missiles. The missiles are very small compared to the meshes they are hitting - could this be an issue?
Try using triggers instead and also make sure to use a non-kinematic rigid body
I tried it, but now sometimes (~50%) they just go right through the meshes... Is there anything else I can try?
sounds like you're moving too fast, increase the fixed time frequency or use raycast to detect collision or wait for unity 3 and use continuous collision detection
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
To help users post good questions and use the site effectively we have posted a user guide. Please check it out.
Answers and Comments
No one has followed this question yet.
Why OnCollisionEnter cannot detect collisions between colliders?
Colliding two GameObjects
Which Object Calls OnCollisionEnter()?
Compound collider does not trigger the parent