so i want to create a 3d menu that the camera rotates on an event. for now im trying to rotate it at the start of the game and have it face a game object.
i declared the camera at myTransform and the target object at Transform. however it just sits there and dont do nothing.
here is my code:
#pragma strict
var myTransform: Transform; //Object you want to rotate
var target: Transform; //The game object that you want to face
var rotationSpeed: float = 5;
function Start () {
myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
}