Pathfinding Help Needed (NPCs getting Stuck)

Didn’t see there was more!
Have you tried adjusting the agent’s size like @LoveTheBears101 suggested?

Alternatively, are the desks;

  • A mesh part with CollisionFidelity set to Default? Try Box or Hull!
  • Non-moving? Have you tried creating a bounding box for it? This would act as a barrier to stop NPCs trying to move through it!
  • Does moving the desks up slightly change anything? It looks as though we’ve disabled jumping, so it might be attempting to path over it.
3 Likes

My apologies, I also did not see that there had been further replies! I am turning this thread to tracked so that I should get notifications in future

Yes - I noticed the reception desk collision fidelity issues and found that when they were set to Box the NPC no longer tried to walk through them, so that’s that issue fixed. Only flaw with that is that now you cannot walk ‘inside’ the reception desk or stand behind it due to the entire box now being collidable. A small price to pay though, in my opinion, for continued reliability.§

However, I have still noticed that with 2 stud walls , or even thicker, NPCs are still liable to get stuck. This is making me more inclined to create my own A* path finding system as has been mentioned before. I would be very grateful if anybody had their own system they would be willing to share, to give me a pointer in the right direction of how to successfully create one. I have tried a couple of times, but gotten nowhere. Currently I am trying to watch videos of A* implementations in other languages to try and convert into Roblox.

Many thanks for the continued support on this thread - much appreciated.

Cheers
Alvin

3 Likes

There is a good number of tutorials on making an A* pathfinder, I made one a while ago but its not very performant. Do you have any images of the 2 stud walls being pathed through at all?

2 Likes

Apologies for the late response. Yes, I do. I think in the third picture, that is recomputing the path / trying to get them to leave the building as the original path broke - but that also gets stuck :confused: This is why I’m looking into alternative A* pathfinding!

3 Likes

This thread is like 2 months old so you’ve most likely figured it out by now, but like you said, you (and anyone else having similar problems) are probably much better off using an A* system with nodes rather than trying to force Roblox’s pathfinding system to work decently.

It might not look as “natural” as compared to rblx’s system, but at least you can control where NPC’s can walk to. Rblx’s system doesn’t really like to work in tight and complex environments like this.

There are a couple of free plugins by CM32 and StealthKing95 that already have the node placement and A* algorithm figured out so, unless you’re a purist, you can use those.

4 Likes

Hey Alvin, i like your videos lol, Anyway to the topic, what i did to prevent the NPC walking into walls was
Whenever the NPC is set to walk to a Node, it firstly has to walk To it’s Exit Node which has the same name but a “Exit” hanged onto it and then walk into the room, same with exitting that room it walsk to the Exit Node and then to the node inside the room, i use pathfinding too btw.

2 Likes