i would like to stop the npc from going to close to the wall or just getting stuck on the wall
i have tried to move the NPC back but that’s not really a fix and looks jank
After that, you should include more details, if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local path = game:GetService("PathfindingService"):CreatePath({AgentCanJump = false,AgentRadius = 2,WaypointSpacing = 1})
path:ComputeAsync(Torso.Position, dest)
local waypoints = path:GetWaypoints()
if path.Status == Enum.PathStatus.Success then
--Module.ShowPath(waypoints)
for index,point in pairs(waypoints) do
NPChumanoid:MoveTo(point.Position)
for allow = 0,25,1 do task.wait()
if not ((Torso.Position - point.Position).magnitude > 4) then
break
elseif stop then
stop = false
return
end
end
--game.Workspace.waypoints[index]:Destroy()
end
end
-- they stoped walking
end