Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to figure out the velocity of a part according to its local axis?

1 answer

✓ Accepted answer

It's just the velocity according to the local space.

local CF = part.CFrame;
local locVel = ((CF-CF.p):inverse()*part.Velocity)

I couldn't think of a good way to do it without stripping the position. Sorry about that.


Edit:
Apparently, CFrame has a member method to do this for you. vectorToObjectSpace

8 comments

0

V3 represents an example Vector3

0

How do I just get one value? Lets say the Z value for example.

0

.Z

0

It needs a vector value. CFrame:vectorToObjectSpace(part.Vector3.Z) wont work. Just use the other one I guess?

0

No dude

0

You take the .Z of the locVel

0

Oh, I see. Thanks, totally derped out there. Lol

0

I was gonna say, I was just crying in my chair like "Please don't do this to me this isn't fair I didn't deserve this"

This discussion is preserved as it was. New answers, comments, and votes are closed.