I have a problem with Unity collision system.
I’m trying to add some 3d objects(rocks) to my scene with mesh collider(convex mesh collider ticked), but no rigidbody. I have a bullet prefab with rigidbody and sphere collider. I attached a script to the bullet prefab, that OnCollisionEnter it should destroy the bullet prefab and play an explosion particle.
Now the problem is that when I shoot the bullet towards the 3d object (rock) it bounces off instead of exploding( aka no OnCollisionEnter called). With other colliders like box, capsule or terrain collider it works just fine.
I tried to add a rigidbody to it, after which it starts working, OnCollisionEnter is called and the bullet explodes, but the problem with this is that I can move the 3d object with physics which I shouldn’t be able to.
To solve this i tried to constraint in the inspector the position and rotation, which I thought solved my problem, because the bullet explodes on contact and the 3d object won’t move, but now my other problem is that I can walk through the object…
Edit: I tried IsKinematic, same rule applies, bullet bounces off, but no OnCollisionEnter called.
Any idea how to solve my problem? So that I would have a 3d object with meshcollider calling OnCollisionEnter on contact with a sphere collider, but not letting me pass trough it?
It works in a sample project and not on the main project, it seems I need to figure it out what happens…