Game Object not being destroyed at 0 lives

I’m trying to get it so that the player game object will destroy itself when lives = 0 which is done by hitting a prefab 3 times called shuriken.

Here is the code I’m using:
public class PlayerMovement : MonoBehaviour {

public float speed;
private Rigidbody2D rb2d;
private int lives=3;
public GameObject Player;
void Start ()
	rb2d = GetComponent<Rigidbody2D> ();

void OnTriggerEnter2D(Collider2D other)
	if (other.gameObject.CompareTag ("shuriken")) 
		lives-- ;
		if (lives <= 0) 
			Destroy (Player);

I should think the FindGameObjectsWithTag should work, here’s the link if you want to look as well Unity - Scripting API: GameObject.FindGameObjectsWithTag

I have made a public variable “Player” and then made a Player prefab from the gameobject, as unity wouldn’t allow me to destroy the actual GameObject. I have dragged the prefab into the public variable on the script but still nothing…

I don’t know what I’ve done!

If this script is a component of “player” then there is no need to have Destroy(player)



In any case, add a Debug.Log(“Trigger Entered”) or something to understand where the code is failin.
Good luck and keep us updated!