Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float turnTorque = 0;
- Vector3 euler = transform.eulerAngles;
- euler.z = Mathf.Lerp(euler.z, -Input.GetAxis("Horizontal") * rollAngle, 1 );
- euler.x = Mathf.Lerp(euler.x, Input.GetAxis("Vertical") * rollAngle, 1);
- Quaternion addpitch = Quaternion.Euler(euler);
- transform.rotation = Quaternion.Lerp(transform.rotation, addpitch, 0.01f);
- Quaternion addRot = Quaternion.Euler(euler);
- transform.rotation = Quaternion.Lerp(transform.rotation, addRot, 0.08f);
- transform.Rotate(new Vector3(Input.GetAxis("Vertical") * pitchSpeed, 0, 0));
- turnTorque = turnSpeed * Input.GetAxis("Horizontal");
- rigbody.AddTorque(Vector3.up * turnTorque);
- rigbody.angularDrag = (turnTorque == 0) ? 10 : 3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement