- Home /
AirPlane Sway Effect
Hello everybody i need little help with this script :
if(horizontal != 0){
plane.Rotate(horizontal * Vector3.forward * Time.deltaTime * -rotateInt);
}
else{
Debug.Log("get back the rotation to 0");
}
i use this script to rotate my plane if i pressed A or D,
but i got to problem
1- how to make back to normal rotation if i didn't press A,D anymore
2-how to make the rotation limited because if i keep hold A or D, he will keep rotate like 360* degree
thanks
Comment
Answer by CommitteeWind · Apr 11, 2013 at 02:20 PM
Interpolate the rotation value from your current back to your target. See: http://docs.unity3d.com/Documentation/ScriptReference/Quaternion.Slerp.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Aircraft Control by Animations ? 0 Answers
How to make a animation rotation js.script? 2 Answers
Character animations accumulate rotation (update: curve missing) 1 Answer