Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I get the velocity of a part in a direction relative to the part?

Asked by 3 years ago

I want to get the velocity of a part, but I want it to be in the x or y or z direction relative to the part and not the world, when the part is oriented in a direction other than 0,0,0. How can I get this local space velocity?

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

https://developer.roblox.com/en-us/articles/object-world-space

part.CFrame:VectorToObjectSpace(part.LinearAssemblyVelocity) will output the velocity vector of the part as relative to the CFrame of the part (in terms of its x,y,z axises)

Ad

Answer this question