Model:MoveTo not moving to the correct position?

Hello developers! I have ran into an issue that I can’t figure out. I used the MoveTo function to clone a model and move it to a requested position. Sometimes, the MoveTo function doesn’t go to the correct position. Is this a bug? Or may it be that I am doing something wrong? Thank you!

local orbs = script.Parent.Parent.orbs
local redorb = workspace.resources.landing
local greenorb = workspace.resources.jumping
local children = orbs:GetChildren()
local order = 1
for p = 1, #children do
	for i = 1, #children do
if children[i].order.Value == order then
			if children[i].Name == "R" then
				wait(children[i].delay.Value)
		local c1 = redorb:Clone()
		c1.Parent = workspace
		c1:MoveTo(children[i].Position)
			c1.inner.Script.Disabled = false
			c1.outter.Script.Disabled = false
	end
			if children[i].Name == "G" then
				wait(children[i].delay.Value)
		local c2 = greenorb:Clone()
		c2.Parent = workspace
		c2:MoveTo(children[i].Position)
			c2.inner.Script.Disabled = false
			c2.outter.Script.Disabled = false
			end
			order = order + 1
			children[i].Transparency = 1
		end
		
	end
end

Video: https://drive.google.com/file/d/1OuFiMs0YfmgwydHNbHvqSf3NE19BSNze/view?usp=sharing

Maybe you should use WaitForChild(), as if it’s inconsistent, then game itself might load the assets at a different speed.

2 Likes

Thank you for your suggestion, I just tried that. Unfortunately it didn’t work. Even with a “wait(1)” function between orbs, it still seems to go to the wrong position.

1 Like

After looking through old dev forum posts, I found out I can use “SetPrimaryPartCFrame” function.

1 Like

You should use :PivotTo to move models instead since it’s both more efficient and bases movement off of the Pivot

3 Likes

Thanks! I might use that in the future.