SimplePath - Pathfinding Module

Sweet thanks for the information!

Then when you are listening for next way point = door, do you then kick off the code to open the door?

which then allows the npc to go through it? (

or do you sill have it so the npc does not collide with the doors, and the door opening is just a visual effect?)

Yes, Since you need to listen to Path.WaypointReached event and call path:Run(target) to continue the waypoints, Instead I call a function to open the door and make the NPC move forward a bit when Waypoint Label is “Door” and do animation, After the animation I call Path:Run(target) again to continue

1 Like

how can i use simplepath to follow the nearest player?

Use this to check repeatedly for the nearest player:

local function FindNearestPlayer()
	while wait(0.5) do
		local found
		local last = math.huge
		for _,plyr in pairs(game.Players:GetPlayers()) do
			local distance = plyr:DistanceFromCharacter(script.Parent.HumanoidRootPart.Position)
			if distance < last then
				found = plyr
				last = distance
			end
		end

		Goal = found.Character.HumanoidRootPart
		return Goal
	end

end
1 Like

Why does this happen when I try to use SimplePath with a custom r15 rig?
(I use Path:Run())

1 Like

I’ve since found the solution to the replied issue. For everyone who utilizes this module, please refer to this post, it may save you a headache in the future:

8 Likes

very good, but how can i do this with something like bodyposition as a example?

1 Like

That’s not simplepath’s problem, it’s the rig. Most likely the arms are causing this.

1 Like

It was issue with my script, the model was supposed to have attributes for speeds, like RunSpeed and WalkSpeed, but I forgot to add them so speed was always 0, I’m just really dumb.

1 Like

I got inspired by this module, and i used it on my first AI chaser for some testings.
and now ill tryna implement my own pathfinding module using this service, thx for sharing us your creation!

1 Like

Please help ):

2 Likes

no matter where it’s at it will keep jumping, is that normal?

3 Likes

It doesn’t work
image
The broken code in concern:

I don’t get the issue, I’m unable to reproduce it (used it in my worst game and didn’t experience the issue)

incredibly useful work thank you

whenever i put my pathfinding chase code onto bigger npc’s they start to turn sharply when i move alot, depends on how big the npc is
any help?

code:

vid:

2 Likes

Delete the while loop, just use the same script as the doc exmaplet

im having a bit of trouble with this.
when using this module on characters that are extremely large (nearly 230 studs tall), the module just doesnt work.
humanoid:moveto() works, but when i try to use path:run() the character just doesnt move.

Have you made sure that it actually works on normal characters too?

Yes, it works on normal characters, and I think I’m using everything correctly.

1 Like