|
Hi everyone, I have tried to make a script to attach to the main camera so that whenever a user is idle for X time, the camera rotates back to it's original position. The thing is that I am not able to do it permanently. Follows my code:
Any suggestions? Many thanks.
(comments are locked)
|
|
slerp function needs to run multiple times to rotates the object in time by the speed that you specified. you just run the function one time in each time that reset is greater than maxreset. create a coroutine that executes till rotattion of your gameobject is equal to the second parameter of your slerp function or returned value has zero in all x,y,z,w values Many thanks. Tom also answered this question on the forum and I have posted there an updated version of the code: http://forum.unity3d.com/viewtopic.php?p=248370&highlight=#248370
Jan 08 '10 at 01:46 PM
cry0
(comments are locked)
|
|
You should be able to fix the code you've given simply by removing the It's also worth noting that you should move this logic out of OnGUI and into Update as OnGUI is called at irregular intervals. If you move it, you'll also need to stop using Events and use Input.GetKeyDown, Input.GetMouseButtonDown etc. Many thanks for answering.
Jan 08 '10 at 01:47 PM
cry0
(comments are locked)
|
