Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

RigidBody - Different angular velocity for each local axis (x y, z)

Discussion in 'Physics' started by DerekMcKinley, Mar 2, 2022.

  1. DerekMcKinley

    DerekMcKinley

    Joined:
    Jun 24, 2014
    Posts:
    19
    Maybe I'm thinking something stupid, I know that the angular velocity of an RigidBody is a vector, and RigidBody.angularDrag is a float, but maybe this can be done with physics math, something like a PID, any ideas?

    what I want to achieve is to limit the rotation speed in the physics of an RigidBody only in one axis
     
  2. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Try multiplyng the angular velocity of that angle by something like 0.5 (Or any number between 0 and 1)
    If you want to completely freeze the rotation freeze the rotation on that angle in the constraints
     
    DerekMcKinley likes this.
  3. DerekMcKinley

    DerekMcKinley

    Joined:
    Jun 24, 2014
    Posts:
    19
    Great, this works perfectly, thanks
     
  4. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Im happy to see that it helped you :D
     
    DerekMcKinley likes this.