- Home /
How to rotate the camera smoothly for just 1 second?
var Destination : Transform; var rotate : int; function OnMouseDown () { // if i use update it just doesn't stop
Destination.transform.Rotate(0, rotate * Time.deltaTime, 0);
}
i need the camera to rotate 90 degrees in one second when i click on the box(link)
thanks for your help Thomas
Comment
Best Answer
Answer by Jeston · Sep 15, 2011 at 05:50 PM
Ummm, add a timer ?
OnMouseDown()
{
active Timer = 60;
}
update()
{
if( activeTimer > 0 )
{
activeTimer -= Time.deltaTime;
//do rotation
}
}
except activeTimer
should always be written together (in that code) and probably by 60 you meant 1 (for 1 second).
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Why is my camera switching angles? 0 Answers
Help getting the target and camera rotation to match 0 Answers
Viewmodel/camera rotation when moving 1 Answer
I can't look up and down because of animation on camera? 2 Answers