Hello everyone, I’m currently making a tycoon with a npc system similar to those of mall tycoon but I’m having some issues. For those who don’t know the npc system is supposed to enter a store, buy something and then leave, it’s made purely for aesthetics. For that purpose I made a simple pathfinding system and it works great but when I use it to enable the npc to navigate through stores it keeps on slamming into walls. I tried using a pathfinding module called SimplePath however, the results remain same. Bellow would be videos screenshots of the results. Any help would be appreciated.
Regular Pathfinding( going into random places ):
Going into stores :
The code :
function NPCModule.Manuever(npc, location)
local startLocation = npc.HumanoidRootPart.Position
local ended = false
local path = PS:CreatePath({
WaypointSpacing = 1,
})
path:ComputeAsync(startLocation, location)
for i=1, #path:GetWaypoints(), 1 do
local point = Instance.new("Part", workspace)
point.Position = path:GetWaypoints()[i].Position
point.Anchored = true
point.Size = Vector3.new(3,3,3)
point.CanCollide = false
npc.Humanoid:MoveTo(path:GetWaypoints()[i].Position)
npc.Humanoid.MoveToFinished:Wait()
end
ended = true
print("Ended")
end
Edit : The NPC cannot jump, if that’s what breaking it I’m happy to add a jump ability to it