Answers for "smooth rotation / movement ?"
http://answers.unity.com/questions/174482/smooth-rotation-movement-.html
The latest answers for the question "smooth rotation / movement ?"Answer by torsten
http://answers.unity.com/answers/174490/view.html
Hi,
I don't exactly understand what you mean, but have a look at Quaternion.Slerp() for smooth interpolation of rotation and for translation Vector3.Lerp().
TorstenSat, 08 Oct 2011 12:13:17 GMTtorstenAnswer by aldonaletto
http://answers.unity.com/answers/174489/view.html
Smooth in Unity means Lerp! (Slerp, for Quaternions) You should use the "Lerp filter", a smart use of Lerp that behaves like a smoothing filter. Attach this script to the camera:
<pre>
var speed: float = 2.5;
var cameraAngles: Vector3; // the target angles around x, y and z
var cameraPos: Vector3; // the target position
function Start(){
cameraAngles = transform.eulerAngles;
cameraPos = transform.position;
}
function Update(){
transform.position = Vector3.Lerp(transform.position, cameraPos, speed*Time.deltaTime);
var newRot = Quaternion.Euler(cameraAngles); // get the equivalent quaternion
transform.rotation = Quaternion.Slerp(transform.rotation, newRot, speed*Time.deltaTime);
}
</pre>
You just set the angle and position you want in cameraAngles and cameraPos, and the camera goes smoothly to the new rotation/position.Sat, 08 Oct 2011 11:28:51 GMTaldonaletto