I have currently have an EnemyCollider script attached to the enemies that looks like so:
function OnTriggerEnter (other : Collider) {
switch(other.tag){
case("PlayerBullet"):
Destroy(gameObject);
break;
case("Player")
Destroy(other.gameObject);
break;
}
}
When a bullet collides with the enemy all is good. But I can’t get it to work on the player object. Both the enemy and the player have a rigidbody component the enemy has a capsule collider with isTrigger set to true.
Where could be the problem?