Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float yRotation = inputDirection.x * Time.fixedDeltaTime * speedMult * rotaRatio;
- Quaternion turnRotation = Quaternion.Euler(0f, yRotation, 0f);
- rb.MoveRotation(rb.rotation * turnRotation);
- float turnAmount = inputDirection.x;
- float maxAngle = 20f;
- float tiltAngle = Mathf.Clamp(turnAmount * -maxAngle, -maxAngle, maxAngle);
- Quaternion tiltRotation = Quaternion.AngleAxis(tiltAngle, transform.forward);
- rb.MoveRotation(rb.rotation * tiltRotation);
Advertisement
Add Comment
Please, Sign In to add comment