- Home /
Other
Is there a way to tell if a hinge joint is moving?
If you use rigibody.velocity to try and detect if a hinge is not moving the number bounces all over, and sometimes goes to 0,0,0 while in the middle of moving.
Is there someway to tell if specifically the hinge is moving?
If not I'll just use velocity and set it so it has to be 0,0,0 for a few miliseconds before it's determined that it's "Not Moving" .
Thanks!
dont think possible, decided to use timer as mentioned above
Answer by logicandchaos · Apr 27, 2021 at 02:08 PM
The rigidbody, in the inspector you can monitor all the forces being applied and access them through code.
hinge joints don't have consistent velocity and will intermittently switch between some vel and 0 vel
Answer by mightWizard · Apr 27, 2021 at 03:12 PM
You can use the code
object.GetComponent().angularVelocity
This has the rotational velocities of an abject and you can compare this to vector3.zero to check for no rotation velocity.