I want player too die when hit the ground or the object I attach this script to, the script I have here kills the player on any collision I only want player to die if hit the ground or an enemy
c+ 2d game
using UnityEngine;
using System.Collections;
public class die : MonoBehaviour {
5.
void OnCollisionEnter2D(Collision2D coll) {
10. Destroy (gameObject,1); //Open door
}
}