Hi all,
I would like to know if there is a collision on my boxCollider.
I send an object on a gameObject (zombie) and i would like to know when my object enter in collision.
When it collides, i would like to destroy my gameObject (zombie)
Here is my script
using UnityEngine;
using System.Collections;
public class zombie : MonoBehaviour {
BoxCollider boxCollider;
// Use this for initialization
void Start () {
boxCollider = GetComponent <BoxCollider> ();
}
// Update is called once per frame
void Update () {
if (boxCollider.isTrigger == true) {
Destroy(this);
}
}
}
I have a rigidbody too on my zombie
Thank you for your help