- Home /
Smooth ship rotation
So I'm currently working on ship movement for a space sim game. I have the ship flying around in 3D space just fine but it can rotate far too quickly. I need some way of slowing down and smoothing out the ships rotation. Here is how I am handling rotation now:
transform.Rotate(0, Input.GetAxis("Horizontal") xAxisRotSpeed Time.deltaTime, 0, Space.Self);
transform.Rotate(0, 0, Input.GetAxis("Horizontal") -zAxisRotSpeed Time.deltaTime, Space.Self);
transform.Rotate(Input.GetAxis("Vertical") -yAxisRotSpeed Time.deltaTime, 0, 0);
Why not lower the AxisRotSpeed variables? By multiplying the rotation degree amount by those variables, lowering those variables lowers the rotation amount.
Answer by wijesijp · Mar 25, 2014 at 04:43 AM
multiplying Time.deltaTime with another parameter you should be able to adjust rotation speed.