function PathFinding(Destination)
local path = pathfinding:CreatePath()
path:ComputeAsync(Body.Position,Destination)
local WayPoints = path:GetWaypoints()
for k, waypoint in pairs(WayPoints) do
hum:MoveTo(waypoint.Position)
if waypoint.Action == Enum.PathWaypointAction.Jump then
hum:ChangeState(Enum.HumanoidStateType.Jumping)
end
hum.MoveToFinished:Wait(2) -- make this wait() maybe?
end
end
PathFinding(Dest)
use to work fine a few months ago, then I stopped coding, yesterday I started again and this code isn’t working I didn’t change anything, tried to download older versions where it worked, didn’t work there either, was there a change in Roblox Studio that does this? or is my code wrong? I tried making everything not cancollideable didn’t work, the npc doesn’t move.
Just tried printing Waypoints it printed a empty table thats probably the problem it can’t get waypoints
also tried this:
` function PathFinding(Destination)`
hum:MoveTo(Destination)
end