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

How can I use BodyVelocity to move an object relatively?

It seems pretty simple, but BodyVelocitys use absolute coordinates to move an object. How can I make it move relative to the objects orientation? I don't have any code because it is a simple request: Make a BodyVelocity move an object forward. Thanks.

1 answer

✓ Accepted answer

In a script, change the Velocity property of your BodyVelocity inside your part to the part's CFrame.lookVector:

local Part = script.Parent -- Assuming the script is inside your part
local BodyVelocity = script.Parent:WaitForChild("BodyVelocity")

BodyVelocity.Velocity = Part.CFrame.lookVector

Same concept can be aplied to move your part in other directions relative to its own position, just play around with your part's CFrame properties. Useful link.

Hope this helps. Have a good day!

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