Advertisement
Eonirr

Untitled

May 25th, 2023
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Vector3 localAngularVelocity = transform.InverseTransformDirection(_rb.angularVelocity);
  2.  
  3. if (_mouseInput.x > _minMouseToActivateX)
  4. {
  5. if (_rb.angularVelocity.y < _maxAngularVelocityY)
  6. {
  7. _rb.AddRelativeTorque(Vector3.up * mouseSensitivityX * /*Mathf.Clamp(_mouseInput.x, -_maxYawClamp, _maxYawClamp) * */_yawTorque);
  8. }
  9. else
  10. {
  11. _rb.angularVelocity = transform.TransformDirection(localAngularVelocity.x, _maxAngularVelocityY, localAngularVelocity.z) * Time.fixedDeltaTime;
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement