Pathfinder: A pathfinding character control module for NPCs

I set MovingTarget to true in the settings.

I will take a look at this issue and tell you what’s wrong. The MovingTarget retargeting mechanics only create new paths when the direction of the target character (or any part/model) changes to have better performance, so it is not really updating with a set time. However I might add something customizable, or fix the issue if it is because of a bug, not sure.

Very late reply but I have figured out what’s wrong. I’ll work on a solution with a new version when I have time.

1 Like

This is by far the best Pathfinding module I have used. Very well-made and documented. The only problem though is that my NPCs get stuck at random times like they try to walk through a wall (NPC is colliding and cannot get through) but obviously can’t get through. Is there a fix to this?

It really depends on which mode you are using it with, are you using it with MovingTarget true or false? Is the NPC getting stuck at turns?

No, I’m not using it with a moving target. What I’m doing is having an NPC exit a room and walk towards another room that’s on the other side of the building. The NPC attempts to walk through the wall because walking through the wall would be the shortest way to get there, instead of walking out of the door and walking into the building.

Can you check the NavigationMesh of that wall? Unless the whole thing has many turns, I could not see any reason why the NPC would do that.

Screenshots will also help.

Hi did you ever add action command options

Could you explain it a bit more, I don’t understand what you meant by action command options.

It is quoted from your reply above above to me about being able to make npcs attack a player

ā€˜

AerodymierProgrammer

Jan 28

Yes it can. You can create a damage function with the callback it has. Maybe in a later release I should provide an extra module with action templates.

ā€˜

Figured it out, but I do have another issue. Would you happen to know why this happens?

Some of the NPCs kinda ā€œhoverā€ away while some of them walk normally.
https://gyazo.com/0a350759dcafe8060ced517e9f245f80

These are already available, if you are talking about the templates, they are not released yet.

1 Like

Strange, can you enable logs for that NPC? If the NPCs have different names you can just filter for that in the output.
With the next release (which should be tomorrow hopefully) I will add more options on debug output verbosity levels, right now it prints a lot which lags Studio.

Version v0.2.2

  • Added ā€œPaths per secondā€ for debugging and benchmarking
  • Improved turn handling when MovingTarget is enabled
  • Added DebugLevel configuration for verbosity of the debug prints
  • Added a new event ā€œOnIdleā€, fires when MovingTarget is enabled and the character is idle (distance is less than retargeting distance or character is out of tracking range)

I made a system where I have NPCs that get seated on a seat, and then after a few seconds, they jump up and the pathfinding to walk out begins.

I have noticed this bug on a few NPCs where they would sit down and just hover out. Do you know why this could be happening?

https://gyazo.com/9b6c91b69d29cbec228e17d615f82ebb

have you added debugging print lines of where ever there is a logic check if condition to see where they last get in the code, and do not move past?

If you are using MovingTarget = false (which should be false in this application) then the module will not run until you change the target and run it again. It’s possible that you made their target the exit and the path happened to go past the seats, and they first got seated and then started to go to the exit, but without seeing your implementation I can’t say anything for sure.

I’m going to take a look. I still love this module, definitely the best one on Roblox. It’s most likely my code that’s bugging rather than the module, so I’m going to keep you updated while I work on the system.

1 Like

Not yet since I have a lot of NPCs that spawn. It would be hard to track the debug lines