Hello everyone.
I’m trying to make a simple sidescrolling shooter game.
The main character is controlled with a character controller and the enemy’s bullets are in a box trigger collider. That’s the code I’m using, wich is placed in the bullets:
function OnTriggerStay (other : Collider) {
if(other.gameObject.CompareTag("Player")){Destroy(other.gameObject);}
}
The script seems to work fine, but only when the main character is moving, when he’s staying still, the collision doesn’t seem to work fine. What I am doing wrong?
Thank you