hi experts!
I am Planning to move my cam if ontriggerEnter collide, and it does…
Now if I go OntriggerExit it still Move the cam after 3 sec… I want to not move the cam if OntriggerExit but what code should i put in…
here is my code thanks in advance…
var mainCam:GameObject;
var waitSeconds = 3;
var thisObj:Vector3;
function Start(){
thisObj = transform.position;
}
function OnTriggerEnter(Other : Collider){
Debug.Log("Enter Collider");
yield WaitForSeconds (waitSeconds);
if (Other.gameObject.name.StartsWith("Crosshair")) {
iTween.MoveTo(mainCam,thisObj,2);
}
}
function OnTriggerExit (Other : Collider){
Debug.Log("Exit Collider");
yield WaitForSeconds (waitSeconds);
//THIS WHAT CODE SHOULD I PUT?
}