Question About Pathfinding Features

Hello, a little bit ago I was thinking of something to do with pathfinding and I took a look at Pathfinding modifiers and I don’t quite know how to use them properly.

IF I Understood correctly , this is what you should be able to do with these, there was somewhat limited documentation since its a relatively new feature

**So the humanoid (me right there) , would pathfind its way to that pink part, and that part would then teleport that humanoid to the other pink part and so on.
SO is this what pathfinding links are or Am I wrong and this is the complete wrong approach to make this random teleport thing I came up with?
**

where I am at:
I looked at this example [Full Release] Introducing the Pathfinding Links for NPCs of what was to expect from this feature and I don’t know what are pathfindinglinks and modifiers, except for what the documentation says that modifiers basically work with regions and can be used to for ex avoid parts and Links are these new waypoint thingies, but I don’t know how to use them. I tried using the example at the bottom and I think the one in the devforum post and they did not really work for me and the look for answers was kind of hard.
Character Pathfinding | Roblox Creator Documentation

Extra Question : Can these be used to make so that the Npc can be somewhat smart and like choose the teleport location ( that is if there were multiple ) so it gets to the target or is that just something that you have to implement yourself?

Hi, Could you please provide the example file so that we can check what might be going on. Regarding you second question(extra) : it is expected that developers should implement the target selection themselves since that is more context based. Please let me know if that answers your question.

1 Like

Well, if you enjoy using Pathfinding links, you can make a PathfindingService with those links.

local PathfindingModifier = game.PathfindingModifier -- Gives you access to pathfinding modifiers
local links = {} -- You'll have to add the links here

PathfindingService:CreatePathfindingLinks(links) -- Gives you a pathfinding link

If you want to do it the old way, you’ll have to do it manually.

local humanoid = game.Players.Player.Character.Humanoid -- Character's humanoid
local path = {} -- Pathfinding path
local regions = {} -- Regions you want the character to avoid

for _, region in pairs(regions) do
  PathfindingModifier:AddAvoidanceRegion(region) -- Add the regions to the pathfinding modifier
end

PathfindingService:CreatePathAsync(path) -- Get the path
local pathfinding = humanoid:MoveTo(path.Position) -- Move the humanoid

Just read the docs, and just understood them less than a .1 of a second lol. Anyways, the links are ways the agent/humanoid can reach to another location. If you read the docs they show an example with the boat. They made it so taking the boat is a viable option to reaching the end location which is the other island, so for your situation, you can use the links to say to the agent to step on this part to get to that other part, and so on. The agent will use that information and calculate the best way to get to the end pos, while using the pathway links you have defined for the agent. And modifiers are a way to tell the agent “If you go near these spots then I will give you less rice”. Meaning the higher the cost on something, the less likely the agent is going to take that route. iirc the minimum should be 1

Thank you for the reply, I later realized that the reason one of my humanoids couldn’t compute its path could be because I had the pathfinding link set to a part that wasn’t the one it was trying to compute. (since I didn’t realize that had to be)

I understand I should probably, also for context the humanoid would choose the floor it was going to with a teleport part, kind of : when you know you have to go to the second floor , so you take the elevator to it.
I had this thought after reading about the “costs” 5 days ago