Option Camera Movement

Help!

I need a camera to move from on place to the other on the click on the “option” button , which is where this code is.

var trans : Transform;
var cam : Camera;

function OnMouseEnter(){
renderer.material.color = Color(1,0,0);
}

function OnMouseExit(){
renderer.material.color = Color(1,1,1);
}

function OnMouseDown(){
  
   }
   
function OnMouseUp(){
iTween.MoveTo(cam,{trans, "time":2});
}

The code’s wrong.

Please help.

Thanks,
Hawx

If the iTween syntax is correct, have you gone through the troubleshoot elements?

(1) Do you have iTween in your project.- lol
(2) Did you try a debug in OnMouseUp - Is it working
(3) Is the trans.transform in a different vector than the cam.transform?
(4) Is the script in your scene. - lol

You would be surprised how many times its 1 or 4. :smile: