Hello everyone. I made a simple turret model. Added guns to it and made it fire. I added a box collider to the turret so whenever the player is in it, the turret will fire. It happened as i thought. Turret firing when player is in the collider. But the problem is i am not being able to make it stop firing when the player is out of the collider. It just keeps firing. Here is the script.
void OnTriggerStay(Collider other)
{
// Track turret
Track();
// Fire turret
if(other.gameObject == player);
{
isFiring = true;
}
Now, how can i make its firing stop as soon as the player leaves the collider???