using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
public float RemainingHealth;
// Use this for initialization
void Start () {
RemainingHealth = 100f;
}
// Update is called once per frame
void Update () {
}
void OnCollisionEnter(Collision coll) {
if (coll.gameObject.tag == "Projetil")
{
Destroy(coll.gameObject);
}
}
this is my health script, still working on the RemainingHealth float, but the collision doesn’t seem to be working. it doesn’t destroy the GameObject, why not?