I have a game object that I am successfully tweening with javascript and iTween. I want to have this script create a reference to the scene’s Main Camera, and tween that camera. How do I do this? Here’s my code so far (which doesn’t work).
var igniter : GameObject;
var camera : GameObject;
function Start () {
lighterUp();
}
function lighterUp(){
iTween.MoveTo(gameObject,{"y":-2.75,"time":3,"easeType": "easeInOutQuad","oncomplete":"lighterTurn"});
}
function lighterTurn(){
iTween.RotateTo(gameObject,{"y":0,"oncomplete":"lighterTurnIgniter"});
}
function lighterTurnIgniter(){
iTween.RotateTo(igniter,{"x":180});
iTween.MoveTo(camera,{"z":-50}); //Doesn't Work
}