|
Hello everyone. I want to rotate my gun to left & right when player moves to left & right. So I made a code like this : This works well, it moves smoothly & good according to the variables that I adjusted. But when I stop walking, it stays in the position which it was at. So all the aiming and other things get messed up. I need to turn the gun back to it's original rotation smoothly. For that, I made a code like that but didn't work : but as I said it did not work. I need help, any ideas ? Thanks =)
(comments are locked)
|
The question has been closed May 12 '12 at 08:29 AM by Inan Evin for the following reason:
Duplicate Question
|
Try transform.rotation = Quaternion.Lerp( transform.rotation , from.rotation, Time.deltaTime *speed); I'm not sure of what is the diff between from and orig though. It did not work, I don't know if I wrote the code & if statements in wrong way but when I put Debug.Log in to else{} it works, but when the code I wrote or the code you said just doesn't work. Thanks for the help though, but you got any ideas ? :)
May 12 '12 at 08:03 AM
Inan Evin
(comments are locked)
|
