MoveTo() doesn't move the part

  1. What do you want to achieve? Keep it simple and clear!
    I want to move the model from replicated storage move to a designated spot

  2. What is the issue? Include screenshots / videos if possible!
    It doesnt move at all. No errors are shown.

local Giver = game.Workspace.PizzaGivers
local ThisGiver = Giver["Pizza Thing"] -- Rename to current giver
local Button = ThisGiver.Button
local Spawner = script.Parent
local Stored = game.ReplicatedStorage.Givers

local pizzas = {
	Stored.TB1Pizza,
}

local function clicked()
	Button.BrickColor = BrickColor.Black()
	local copy = pizzas[math.random(#pizzas)]:Clone()
	copy:MoveTo(Spawner.Position)
	copy.Parent = workspace
	task.wait(10)
	copy:Destroy()
	Button.BrickColor = BrickColor.Green()
end
wait(3)

Button.ClickDetector.MouseClick:Connect(clicked)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

use :PivotTo() and not :MoveTo(), moveto is for humanoid’s i think

MoveTo() is a function for humanoids.


Instead, just set the position property.


I would also recommend using Debris to handle temporary objects.

PivotTo() only works with models I believe. I may be wrong, though.

I found out that MoveTo() is a function with hte same name both for models and humanoids.

PivotTo() moves a model’s Priamry part to the given CFrame
MoveTo() moves a model’s PRIMARY PART to a given Vector3.
image

I’m pretty sure that the reason it isn’t moving is because the model’s don’t have a primary part, or they aren’t welded together.

Ah, alright.

Character limit

Its welded together and has a primary part.

It is a model.

Character limit.

OH. I think I know why. When parts are in ReplicatedStorage, their positions or anything else cannot be edited until they’re out of storage. Make MoveTo() appear after you set its parent to workspace. I had a problem similar to this once before.

Another thing, scripts don’t run in replicatedstorage.

1 Like

That’s why there aren’t any errors. Because the position is being changed, but immediately being changed back because the part is still in ReplicatedStorage.

cheers. I placed MoveTo() after moving the parent and it works.

1 Like

Glad that you found the solution!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.