In the following segment, everything works properly EXCEPT FOR the MoveTo() line.
As a section from a pathfinding AI, this code creates a tiny part at the location of the node for the zombie to move to. This part IS created, in the CORRECT place, but the zombie won't budge. The Humanoid's WalkSpeed is set to 8, and when I click on it in a running game, the property WalkToPart reads TargetPoint.
At best, I get a slight movement when the code first runs, but then they all freeze up.
No output errors. What's wrong?
x = 1
container = Instance.new("Model")
container.Name = "TargetPointHolder"
container.Parent = Workspace
for i=1, #targetPath do
targetpoint = Instance.new("Part")
targetpoint.Name = "TargetPoint"
targetpoint.Anchored = true
targetpoint.CanCollide = false
targetpoint.FormFactor = "Custom"
targetpoint.Size = Vector3.new(0.2, 0.2, 0.2)
targetpoint.Transparency = 1
targetpoint.Parent = container
targetpoint.CFrame = CFrame.new(targetPath[x].Value)
script.Parent.Zombie:MoveTo(targetPath[x].Value, targetpoint) --RIGHT HERE
wait(8/script.Parent.Zombie.WalkSpeed + 0.1)
x = x + 1
end
FYI - targetPath is a table containing Vector3 values that tell where each node along the path is located.

1 comment
Are you positive the "targetPath" locations are correct?