Hi, Im trying to make my player destroy a box when collides with it. Here's what I have so far:
using UnityEngine; using System.Collections; public class NewBehaviourScript : MonoBehaviour { private GameObject objPlayer; private GameObject objBox;
void Start () {
objPlayer = (GameObject) GameObject.FindWithTag ("Player");
objBox = (GameObject) GameObject.FindWithTag ("Finish");
}
// Update is called once per frame
void Update () {
if ( )
{
removeMe();
}
}
void removeMe () // removes the character
{
Destroy(gameObject);
}
}
What do i need to put in the if statement to make my Player destroy the Box. I would appreciate any help you can give me as i have no idea what i am doing. Thanks in advance!