Move BodyPosition forward

Hello I am having difficulties with the BodyPosition class. Every frame I’d like to move the BodyPosition in a direction (Let’s just use forward for now); however, the code I am using, which to my knowledge should be working, seems to only be firing once. Even though it is being called every frame. This means it only moves ‘forward’ once and that’s it!
I have tried the following to get it to move forward:

BodyPosition.Position = RootPart.Position + RootPart.CFrame.LookVector
BodyPosition.Position = (RootPart.CFrame * CFrame.new(0,0,-1)).p
BodyPosition.Position = RootPart.CFrame.p + RootPart.CFrame.LookVector

But to no avail it only moves one stud forward and doesn’t move any further. Any suggestions would be very much appreciated

1 Like

Are you doing all three of those at once, or just one of the three? Share more of the code so that we have a better time getting an answer.

Made a discovery that the RootPart.Position doesn’t seem to change according to the script?
The following is inside a loop

BodyPosition.Position = RootPart.Position + RootPart.CFrame.LookVector
print(RootPart.Position) --Prints the position the part is at
print(BodyPosition.Position) --Prints the BodyPosition.Position property

The physical part moves and the loop continues executing, but the print for the positions never change?

Just one, but I’ve tried all three individually with no luck.

local RootPart = script.Parent.RootPart
game:GetService(“RunService”).Stepped:connect(function(time, deltaTime)

RootPart.BodyPosition.Position = RootPart.Position + RootPart.CFrame.LookVector

end)

Figured it out. The RootPart (because it had a Body mover) needs the network ownership set to the server???