private void OnTriggerEnter(Collider other) { PlayerAvatar player = other.GetComponent <PlayerAvatar>(); if (player) { player.hitsDoor(name); } }