Pathfinding tries to walk anywhere but door

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want NPCs to pathfind from a parking spot to a seat INSIDE the pizzeria. Walking through a door.

  2. What is the issue? Include screenshots / videos if possible!
    The NPCs try to walk through the windows and get stuck at corners. Aswell, when they get close to going through the door, they start walking towards a corner or window instead of through the door.




    (Here you can see that the NPCs all want to go through at the EXACT same spot, even though they got different parking spots and different seats to walk to.)

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve searched through all of the forums on DevForum and tried adjusting the AgentRadius and AgentHeight. I’ve also tried disabling collison and CanTouch + CanQuery on the door descendants. Thing is, the NPCs were able to pathfind correctly before, but during time they stopped working correctly.

Details:


(Here is the code that makes the NPC pathfind from their parking spot to their assigned seat) “SmallBarrier” is the barriers that are set around the pizzeria shown in the screenshot below:

“Region” is right now not existing as I tried removing the “Region” parts to see if that was the issue.

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

uhm, i believe you must put a pathfindingmodifer, on the door, and set the passthrough property to true. also i reccomend you set your radius and height to be higher, and the small barrier might be causing issues aswell.

what i reccomend:
local Path = PathfindingService:CreatePath(
{AgentRadius = 2.5, AgentHeight = 5,AgentCanJump = true,AgentCanClimb = true,WaypointSpacing = 3}
)

Thank you! I will try that out right now and update in a sec!

Did sadly not work either, now they go to a different corner lol. It’s weird cause before they start walking to the path they jump and walk in a circle for like 1 second and THEN they try to walk to seat. Though they end up in this corner and tries to walk straight into the pizzeria. I’ve adjusted some of the “SmallBarrier” but doesn’t seem to work either.

We’ve made collision parts only for the NPCs and removed the “Costs” part of the Pathfinding which seems to work so far.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.