I’m trying to figure out how to detect the collision of a rigidbody (a bullet) with another object, such as a player, a target (not necessarily a rigidbody, unless it needs to be). How would I do this?
Update:
I tried using this code:
function OnCollisionEnter(collision : Collision)
{
Destroy (gameObject);
}
It was meant to destroy the bullet (where the script is contained), but it didn’t work. I’m not sure if this matters but, the bullet is a rigid body with collision detection set to continous. What it’s colliding with isn’t a rigidbody, and it has a mesh collider on it. But the thing is that what I’m trying to make the bullet detect the collision on is imported, and has a mesh collider on it, not a box collider. So what would I do about that?