Let me explain the question first:
I have a part that is rotating in air, like this. It’s just normal physics, things rotate while in the air.
I want it to keep its angular momentum, and slowly stop itself from rotating to get to a specific orientation (the blue part’s orientation in the gif).
Here’s what it looks like, when it’s just slowly coming to a stop:
RunService.Heartbeat:Connect(function(deltaTime: number)
do -- drag to stop
if p.AssemblyAngularVelocity.Magnitude > 0 then
p.AssemblyAngularVelocity -= p.AssemblyAngularVelocity * 4 * deltaTime
end
end
end)
It stops, but not at the orientation I want it to.
I tried using an AlignOrientation, but it doesn’t really achieve the effect I want:
(first part with RigidityEnabled, second part without)
The part looks like it’s being pulled back towards the target orientation, as if taking the shortest route instead of its current angular velocity… it should look natural, that is, it considers the angular momentum of the object.
How can that effect be achieved? I’m thinking it should be achievable with some advanced physics and math trickery the same way you can calculate the velocity (or jump force) needed to jump to a certain height, but i just can’t wrap my head around it haha