- Home /
Question by
Ekozmaster · Jan 06, 2015 at 04:36 PM ·
quaternionlerpshipboat
Hot to Steer a Boat with Quaternion.Lerp?
Excuse my english, because i'm brazilian...
I wanna rotate my boat with Quaternion.Lerp because i wanna to do it rotate smoothly and decrease the rotate speed when the (A or D) key isn't pressed. But it rotates only 5°, and no more...
Please Help me here? tanks XD...
Code Javascript:
var bombordo = Quaternion.Euler(transform.rotation.x, transform.rotation.y - 5, transform.rotation.z);
if(Input.GetKey (KeyCode.A)){
transform.rotation = Quaternion.Lerp(transform.rotation, bombordo,2*Time.deltaTime);
}
Comment