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

Why is BodyPosition.Position not moving it's parent?

So I'm basically trying to make a moving platform for a obby. I'm using bodyposition because I want the player to move with it. For some reason, the platform doesn't move though. Here's my code:

model = workspace.MovingPlatform2

model.BodyPosition.Position = Vector3.new(179.317, 7.937, -611.755)
model.BodyPosition.MaxForce = Vector3.new(math.huge, 0, 0)

while true do
	for i=1, 24, 1 do
		model.BodyPosition.Position = Vector3.new(model.BodyPosition.Position.X + 0.5, 					 
	   	model.BodyPosition.Position.Y, model.BodyPosition.Position.Z)
		wait(0.01)
	end
	for i=1, 24, 1 do
		model.BodyPosition.Position = Vector3.new(model.BodyPosition.Position.X - 0.5, 	 		 
	   	model.BodyPosition.Position.Y, model.BodyPosition.Position.Z)
		wait(0.01)
	end
end

It's in a local script.

3 comments

0

Honestly it would be easier if you tweened the part than set its position linearly.

0

But again you would need the player to move with it oof

0

Would bodyposition work tho

1 answer

nvm I solved it somehow by messing with physical properties and replaced the for loop into a repeat until

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