Im trying to make it so when 2 Objects collide it destroys one of them but for some reason they move through eachother so the Box Colliders hit eachother but its not picking up them colliding.
They are on the same layer and are both untagged here is my code
var collision: Collision;
var GameObjectName: String;
function Start () {
}
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name==GameObjectName) {
Debug.Log("Please Work");
Destroy(gameObject);
}
}
The game Object Name is set to the right name
Any ideas - sorry if it doesnt make alot of sense im not very good at communicating.
Please and Thankyou