Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 euler = rb.rotation.eulerAngles;
- float yRotation = euler.y + (inputDirection.x * Time.fixedDeltaTime * speedMult * rotaRatio);
- float maxTilt = 20f;
- float zTilt = Mathf.Clamp(inputDirection.x * tonTruc, -maxTilt, maxTilt);
- Quaternion newRotation = Quaternion.Euler(0f, yRotation, zTilt);
- rb.MoveRotation(newRotation);
Advertisement
Add Comment
Please, Sign In to add comment