Hello. I dont know why this script is not working. First I want to store an object’s position. After a few seconds, I want to check to see if the object has moved, and if it has, destroy it. For some reason, the object is not destroying itself(even though it’s position is different from the “space” variable)…why?
var space: Vector3;
function Start(){
Invoke("Setup",1);Invoke("Check",3);
}
function Setup(){
space=transform.position;
}
function Check(){
if(space!=transform.position){
Destroy(gameObject);
}
}