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

Why doesn't the player move with the new block position?

randPlat.Position = randPlat.Position + Vector3.new(0, 1, 0)

The random platform is supposed to move one stud up, but when a player steps on the platform while it moves, the platform will just move on top of the player's head. How would you make it so that the player moves with the new block position?

2 answers

✓ Accepted answer

You are setting the plate's Position, consider using CFrame instead.

Position moves the brick upwards if it is obstructed by anything.

CFrame moves the brick to exactly where you want it, obstructed or not.

Here's a fixed version of your code.

randPlat.CFrame = randPlat.CFrame + Vector3.new(0, 1, 0)

Tell me if its still broken ^^

This is one way to do it. However if your plateform is like an elevator in a enclosed shaft I would not recommend using CFrame at all. Use a body position instead. Just insert a bodyposition and bodyGyro into the platform.

randPlat.BodyPosition.Position =  Vector3.new(0, 1, 0)

Tell me if this doesn't work.

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