I use the following script:
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Enemy")
{
Destroy(this.gameObject);
Application.LoadLevel(Application.loadedLevel);
}
}
The problem is that the collision only causes the player’s death if he moves into the enemy. If it’s the enemy who moves into the player nothing happens - the enemy just stands next to the player.
Any idea why this is happening?