I want my npc to move from where it stands, and to move to a part,
But for some reason it stopped working I made it work, then for some reason it randomly stopped. idk why but any tips on why that would be ?
I tried looking up yt videos and looking up how to fix the issue but so far nothing worked, I’m kinda new to scripting so maybe that’s the reason but I tried for hours and couldn’t find anything.
here’s the part where it makes it move (and yes the john is the npc and its r6 and it has all the parts it needs to work)
and if you need more info, it just doesn’t go to the part and its just a straight path to the part with nothing in the way. and it is all unanchored. and it doesn’t show any errors.
code:
local PathFind = game:GetService(“PathfindingService”)
local JohnHumanoid = workspace.John:WaitForChild("Humanoid")
local JohnTorso = workspace.John:WaitForChild("Torso")
local path = PathFind:CreatePath()
local waypoints = path:GetWaypoints()
path:ComputeAsync (JohnTorso.Position, workspace.STSLCS:WaitForChild("StarlightTownCutScene1").MovePart.Position)
for i, waypoint in pairs(waypoints) do
JohnHumanoid:MoveTo(waypoint.Position)
JohnHumanoid.MoveToFinished:Wait(0.1)
end
JohnHumanoid:MoveTo(workspace.STSLCS:WaitForChild("StarlightTownCutScene1").MovePart.Position)
any tips or the reason why it doesn’t work any more would be helpful thanks in advance.