Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Problem with MoveTo, any ideas?

Asked by 10 years ago

Usually I don't have a problem with MoveTo, but as I try to move a model in this script it flickers from side to side, which ruins the entire effect. Is there any other way to move the model, or is there a mistake I'm making which is screwing up MoveTo?

local xpos = Workspace.Model.Base.Position.x     
wait(3)


delay(0,function()
for i = Workspace.Door1.Position.X, Workspace.Door1.Position.X - Workspace.Model.Base.Size.X/2, -0.2 do
Workspace.Door1.Position = Vector3.new(i, Workspace.Door1.Position.Y, Workspace.Door1.Position.Z)
wait()
end
end)

delay(0,function()
for i = Workspace.Door2.Position.X, Workspace.Door2.Position.X + Workspace.Model.Base.Size.X/2,  do
Workspace.Door2.Position = Vector3.new(i, Workspace.Door2.Position.Y, Workspace.Door2.Position.Z)
wait()
end
end)

for i = Workspace.Model.Base.Position.Y, Workspace.Door1.Position.Y, 0.1 do
Workspace.Model:MoveTo(Vector3.new(xpos, i, Workspace.Model.Base.Position.Z))
wait()
end

1 answer

Log in to vote
0
Answered by 10 years ago

The bricks are probably the same size, and moving one to another's position will cause flickering since they're in the same spot as each other. I'd recommend you make one a custom size, which is just a tad bit smaller than the other.

Ad

Answer this question