check when a projectile that is a trigger hits a mesh that is also a trigger

void OnTriggerEnter(Collider current)
{
print(“here”); // never gets here.
if (current.tag == “Projectile”)
{
obj.health -= 10;
}
}
I want to check when a projectile that is a trigger hits a mesh that is also a trigger. The code above does nothing. It never actually gets inside the OnTriggerEnter.

Please help

One of them should have a kinematic rigidbody attached, you can check the isKinematic checkbox on the rigidbody to make it kinematic. so
do these steps

  1. Attach a Rigidbody component to your projectile prefab.
  2. check the isKinematic checkbox on the rigidbody
  3. run the game now

Kinematic rigidbodies don’t act like normal ones so you can move the gameObject like before and it’s still a normal triger and can not be moved by forces.

take a look at link textphysics manual pages for more information about the collision matrix and messages being sent between different colliders and kinematic rigidbodies.