I’m sure there’s a simple explanation to this, but I cant get my head around it. Any help would be much appreciated. Here goes:
My enemy tanks have a rigidbody (for navmesh agent), a physical box collider (to detect being shot) and a large sphere trigger collider (to detect player).
My player has a rigidbody and a large sphere trigger collider (for detecting enemies).
Problem: The TRIGGER collider of the enemy is triggering the player’s trigger collider. So my player is detecting the enemy long before it should.
What am I doing wrong?
Got it:
OnTriggerEnter(Collider other)
{
if(other.isTrigger)
return;
...
}
Leaving it on in case it helps anyone else