✓ Accepted answer
To simply move a model, you can use the :SetPrimaryPartCFrame() method like so:
local model = workspace.Model
model:SetPrimaryPartCFrame(CFrame.new(0,0,0))
If you have a model with a humanoid in it (such as an NPC), you can use the :MoveTo() method. Please note that this method exists in models and humanoids, but when called upon a humanoid, it will cause the character to walk to the given point.
local npc = workspace.NPC
npc.Humanoid:MoveTo(Vector3.new(0,0,0))
Additionally, this method can be paired with the MoveToFinished event to detect when the character has reached their destination.
local npc = workspace.NPC
npc.Humanoid:MoveTo(Vector3.new(0,0,0))
npc.Humanoid.MoveToFinished:Connect(function(reached)
print("Destination Reached!")
end)
The reached parameter returns true if the goal is reached within 8 seconds. Otherwise, it returns false.
5 comments
model:GetChildren().Position = Vector3.new(position) . This should work, Models are basically Folders for the Parts inside of the Model. Make sure that there is only 1 Part inside the Model, but the other ones inside that Part. This won't change anything other than keeping only one part instead of multiple inside the Model.
no..
this is why we need to be able to downvote comments
true
Please accept gioni's answer, it is the correct answer.