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

Can't set a part's position?

Hello,

I want to move a part in the workspace using .Position but it doesn't seem to work, here is the script:

part = game.Workspace.Part
while wait() do
part.Position = part.Position + 0, 1, 0
end

It drops an error!

Please help!

3 answers

✓ Accepted answer

Hello there,

Your script doesn't work because you didn't use Vector3.new() to specify the position, here is the fixed script for you:

part = game.Workspace.Part
while wait() do
part.Position = part.Position + Vector3.new(0, 1, 0) --You forgot Vector3.new() 
end

Hope this helped.

Frag

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

A position is a Vector3 value, so you can't add or subtract numbers to it, only other Vectors. Therefore in order to offset it's position you would need to do...

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

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