What I want is to be able to destroy the cube when the third person character hits the cube…I have this code so far:
#pragma strict
var other : GameObject;
function Start () {
}
function Update () {
}
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name=="Character") {
Destroy(gameObject);
}
}
But it is not working, the third person camera is called ‘Character’, and the cube is called ‘Cube1’.
Any suggestions will be appreciated!