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

How to get :MoveTo Function to actually move a model?

Asked by 5 years ago
Edited 5 years ago

so i have found the model in question using

local bomb = game.ServerStorage:FindFirstChild("Bomb")

then i tried to move the model using the MoveTo function and changing its parent with NewArain simply being a clone of the model done with NewArain = bomb:clone()

NewArain:MoveTo(Vector3.new(264,105.5,134))
NewArain.Parent = workspace

but when running the code the model doesn't move to the vector 3 shown here

2 answers

Log in to vote
0
Answered by
Elixcore 1337 Moderation Voter
5 years ago
NewArain.Parent = workspace
NewArain:MoveTo(Vector3.new(264,105.5,134))

you need to set the parent first and then the position.

Ad
Log in to vote
0
Answered by 5 years ago

A few things when it comes to this, btw I am sorry if this is bad because I am phone. First, I would call :MoveTo more as a command mainly because your telling something to do something. Secondly make sure to PARENT the clone. Lastly you wanna make sure the model has a primary part and the primary part is not anchored. Now again I am on phone so I can't provide examples. Say you had a dummy. You would want to make sure the HumanoiRootPary Is not anchored or t would prevent the model from moving. If what I said doesn't work, unanchors all. If it falls part weld it. Hoped this helped sorry for bad quality answer. If you get an error comment. Best of luck

Answer this question