Question by
Sumsarlo · Nov 08, 2018 at 02:18 PM ·
kill player
How can i make a script, that makes an enemy/item kill a player on collision?
I need the enemies in my game to send the player back to the start menu/kill the player on collision.
Comment
Answer by TumkasPvP · Apr 22, 2020 at 09:55 AM
void OnCollisionEnter(Collider col)
{
// This function will work ever if your object have collision with other objects
if (col.gameObject.tag == "Enemy")
{
Destroy(col.gameObject)
}
}
can u please write it so that everything dosen't collide together.