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

Part is not moving upward when it is supposed to. Why is this?

brick = game.Workspace.Part

while true do
	wait(5)
	brick.Position = brick.Position - Vector3.new(0, 50, 50)
end

For some reason, the code above is just making the part disappear after five seconds.

(Don't laugh, please. I am new to scripting.)

1 answer

✓ Accepted answer

I don't believe the part is disappearing, it's just moving to a new location and since it's 50 studs down and 50 studs in the Z axis you don't know where it is.

To make it move upwards instead of down change brick.Position = brick.Position - Vector3.new(0, 50, 50) to brick.Position = brick.Position + Vector3.new(0, 50, 50)

The reason behind it getting down (which gives it the illusion of disappearing) is that you are subtracting from the position by 50 studs, making it go under the baseplate.

To fix this, just make the "-" into a "+".

brick = game.Workspace.Part

while true do
    wait(5)
    brick.Position = brick.Position + Vector3.new(0, 50, 50) -- the brick will move 50 studs up and 50 studs away
end

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