- Home /
Smooth Position Change (Ironsights)
I have the positions for the gun model stored in the script for my weapon for when it goes into ironsights. I've been able to make the gun sway by doing so by using the rotation commands and have it smoothly rotate, but I was wondering if there was a way to smoothly move the weapon from one set of x,y,z to another x,y,z. I have the positions as GunX,GunY and GunZ and the Ironsights positions as ZoomX,ZoomY and ZoomZ.
So my point is, how would I be able to get it to move from one to the other smoothly?
Answer by almo · Jul 22, 2011 at 02:11 PM
I think you're looking for Lerp.
http://unity3d.com/support/documentation/ScriptReference/Vector3.Lerp.html
Your answer
Follow this Question
Related Questions
GameObjects not moving smoothly when camera is also moving 2 Answers
transform.Position smoothly? 2 Answers
How to smooth movement object in one-axis? 1 Answer
Camera rotation around player while following. 6 Answers
portal problem 1 Answer