Eonirr

Untitled

Mar 5th, 2025
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Vector3 euler = rb.rotation.eulerAngles;
  2.  
  3. float yRotation = euler.y + (inputDirection.x * Time.fixedDeltaTime * speedMult * rotaRatio);
  4.  
  5. float maxTilt = 20f;
  6. float zTilt = Mathf.Clamp(inputDirection.x * tonTruc, -maxTilt, maxTilt);
  7. Quaternion newRotation = Quaternion.Euler(0f, yRotation, zTilt);
  8. rb.MoveRotation(newRotation);
Advertisement
Add Comment
Please, Sign In to add comment