Help with BodyPosition

I am trying to make a moving part in an obby that a player can stand on properly without falling off, so I’ve tried tween but tween doesn’t allow players to stand on the part when it’s moving.

I then researched and found out a bit about BodyPosition and that it can be used as an alternative to tweening that allows players to stand on the moving part. But, I have tried to make a script that loops the BodyPosition but it doesn’t work.

Here is my script:

local pointA = Vector3.new(-160, 160.25, -492)
local pointB = Vector3.new(-160, 160.25, -452.25)
local bp = script.Parent:WaitForChild("BodyPosition")
while true do
	bp.Position = Vector3.new(-160, 160.25, -492)
	wait(2)
	bp.Position = Vector3.new(-160, 160.25, -452.25)
	wait(2)
end
1 Like

add bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)

That doesn’t seem to do anything or fix the problem…

He thinks that the reason behind your problem is that the forge applied is not enough to move something as heavy as the object that you are about to move.

Maybe you should check for the “Anchored” property of the object and/or place the script in other places where it can be executed, so it might work

Btw, you can only move something if the bodyposition is parented to a “BasePart” class, for which are “MeshPart”, “Part”, “UnionOperation”

If there is a way, please try to upload the explorer structure of your scripted object as well.

I already tried unanchoring it but it didn’t work. And yes, it is a normal part.

Here is a little screenshot of what I’m trying to script looks like in the explorer: image

Maybe BodyPosition.P is too low

What should I set BodyPosition.P to?

Set BodyPosition.P to 10000

It works now! But, how do I make it a bit slower? It is very fast.

add BodyGryo to the part

edit: accidentally edited the post :confused:

Also I just noticed that when I jump on it, it flips. Do you know how I would prevent it from rotating?

Add BodyGryo to the part to stop it flipping

Adding the BodyGyro seems to have stopped making it flip, but it still rotates. How would I stop it from rotating altogether?

Set BodyGryo.MaxTorque to 400000, 400000, 400000

I have another question if you’d be kind enough to answer it for me. How would I make a part stay on top of the moving part? Because I want a killbrick to be on the center of the moving part. I’ve tried using an attachment but it didn’t work.

Weld the kill brick onto the part using a WeldConstraint

I tried that but it didn’t work.

Edit: the part just fell into the abyss

Use a normal weld then (it will move into the centre of the part)