Rotation values

How can you change a rotation value on an object via keypress. Instead of the object smoothly turning, how can you make it snap to that rotation value?

1 Answer

1

direct from the docs:

var yRotation : float = 5.0;
function Update () {
yRotation += Input.GetAxis("Horizontal");
transform.eulerAngles = Vector3(10, yRotation, 0);

unparent the camera from the object. add a script to the camera that sets the camera position to the position of your desired object transform in Update().