Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does MoveTo teleport the NPC instead of making them walk?

I'm making a randomly walking person that walks between a set of nodes I made but for some reason he just teleports to each node??

Heres my script :

while wait() do
    local points = game.Workspace.Nodes:GetChildren()
    local randomPoint = points[math.random(1,#points)]
    local Minion = game.Workspace.NPC
    local Table = {}

    Minion:MoveTo(randomPoint)
    repeat wait() until (Minion.Torso.Position - randomPoint.Position).magnitude <= 2 
end

1 answer

✓ Accepted answer
while wait() do
    local points = game.Workspace.Nodes:GetChildren()
    local randomPoint = points[math.random(1,#points)]
    local Minion = game.Workspace.NPC
    local Table = {}

    Minion.Humanoid:MoveTo(randomPoint) -- Use it on Humanoid (if it has humanoid)
    repeat wait() until (Minion.Torso.Position - randomPoint.Position).magnitude <= 2 
end


MoveTo() used on a model will make the model teleport to that position, but using MoveTo() on a Humanoid will make it walk.

This discussion is preserved as it was. New answers, comments, and votes are closed.