- Home /
Mesh Collider STOPPING Objects Instead of Detecting Collision
So before I remembered about Unity Answers, I posted my issue here:
http://forum.unity3d.com/threads/239083-Mesh-Collider-Troubles-(Collision-Detection)
A brief explanation is that the bullets are supposed to hit an object and get destroyed, and it works properly on a cube. However, with an imported asteroid model, the mesh collider is stopping the bullets rather than destroying them. There is an image and my OnCollisionEnter function included in the link I provided.
Since then I've tried adding a rigidbody to the Asteroid and that semi-worked. It was sort of hit and miss with the bullets being destroyed though. They also were pushing the asteroid away, which I don't mind so much, I can just give the asteroid a large mass to limit the amount it moves. From what I understand though, with OnCollisionEnter, only ONE of the objects needs to have a non-kinematic rigidbody attached to it. What am I missing?
Answer by sebrobitaille · Apr 09, 2014 at 04:52 AM
I don't know what might be causing this, all the code looks fine. But on thing you could try us making the collider a trigger an and using OnTriggerEnter instead.
Hmm yeah it must have been one of those unexplained occurrences where everything is fine but decides it wants to be a douche :P. I've fixed it with the method mentioned above, and it's working fine now :)