Show current AngularVelocity on constraints


#1

https://wiki.roblox.com/index.php?title=API:Class/HingeConstraint

I want a property that tells me what the current velocity is. My current use case would be a much more accurate way to do certain car constraints. One of them would being able to access how quickly a car is steering & how fast wheels are spinning.


#2

Yes it should be possible to implement an api for this, although here is a getRelativeVelocity method, in pseudo code:

a0, a1 - the two attachments of the constraint
dv = a0.WorldSpacePrimaryAxis.Dot( a1.Parent.RotVelocity - a0.Parent.RotVelocity )

gives you the relative angular velocity of the two parts around the axis of the hinge.