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 =)
The question has been closed May 12 '12 at 08:29 AM by Inan Evin for the following reason:
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.
answered May 12 '12 at 05:32 AM