[SOLVED] Pathfinding Link Ignored By NPC

Hello!

Is it normal that it’s not showing the circles anymore to be able to see if the pathfinding link is projected correctly? I just can’t get them to work with ladders and my pathfinder completely ignores the pathfinding link even though I included the same Label inside the “Costs”.

TrussBug

Here the SpawnLocation is the “goal”. (It’s at the top of the window) But my path status is “NoPath” whenever It tries to pathfind to it. Here is a video:

Did I do anything wrong?
My pathparameters: AgentRadius = 2, AgentHeight = 5.125, AgentCanJump = true, WaypointSpacing = Default, Costs = {ClimbTruss = 1} – The article about pahfinding links says that I should give a cost to these links. (It also doesn’t work when I remove this cost.) I set the “Label” property of the pathfindinglink to “ClimbTruss” too.

My studio version is up to date and here’s the place file:
PathfindingLinks.rbxl (54.1 KB)

You can’t use PathFinding to make an NPC climb ladders. I don’t know why, but it just doesn’t work, unless you manually code your NPC to climb a ladder using TweenService when it is in front of a ladder.

But I’ve seen people making NPCs able to climb ladders before with the pathfinding link. In fact, yesterday the pathfinding link got fully released and people were posting their NPCs climbing stuff.

I believe these developers were able to have their NPCs climb stuff by manually coding it in, just use PathFindingModifiers to have your NPC stop in front of a ladder, then use :MoveTo() to have it climb the ladder, then resume PathFinding your NPC.

Also, you don’t need to put “[NOT SOLVED]” in your title, it is assumed until you mark a post as the solution.

In this video at around minute 8 they were able to make the character climb without any coding, just :MoveTo(). The pathfinding link should make it possible for the NPC to think that there is a path. But instead of even making a path, it just gives a path status called “NoPath”. The video shows the beta of the pathfinding link but it works almost exactly the same now. The reason I put “Not Solved” on my post is because it grabs more attention and some posts don’t actually mark it as solved.

This is exactly what I meant, when it comes across a ladder, you can you use :MoveTo() to make the NPC climb the ladder, if you are asking for a script, just ask.

Are you understanding what I’m saying? How am I supposed to use :MoveTo() when I don’t even have a path that has waypoints. The problem is that I don’t even get waypoints because the path doesn’t get generated even though I put down a pathfinding link that should close the gap where the player should “climb up”.

Here’s my code and place file if you want to check it out:
PathfindingLinks.rbxl (54.1 KB)

Alright, after 2 hours I figured it out. So, I have been messing with it and wrote this script:

local pathFindService = game:GetService("PathfindingService")
local npc = [Your NPC]
local rootPart = npc:WaitForChild("HumanoidRootPart")
local humanoid = npc:WaitForChild("Humanoid")

local path = pathFindService:CreatePath()
path:ComputeAsync(rootPart.Position, workspace:WaitForChild("SpawnLocation").Position)
local waypoints = path:GetWaypoints()

for i, waypoint in pairs(waypoints) do
	humanoid:MoveTo(waypoint.Position)
	humanoid.MoveToFinished:Wait()
end

As it turns out, your current dummy is not compatible with PathFinding at all; I inserted an NPC from one of my other games and it works. But even after swapping the NPC, it still wouldn’t climb the ladder, so I opened a new place, copied everything over, and it worked like a charm. So, you did something in your place that is preventing you from PathFinding. Some things that may factor into this are:

  • There is a setting that needs to be enabled in ‘Studio Settings’
  • Make sure Archivable is true under your PathFindingLink (It is false by deafault)

I made sure all of these things were enabled in your place, but it still didn’t work, so if you create another place, just make sure these are done. Let me know if you find out why PathFindingLinks don’t work in your place.

2 Likes

Thank you for helping me! :smile: But it still doesn’t make a path in a new place. Which NPC is compatible with PathFinding and what setting in “Studio Settings” are you talking about specifically? Is it possible if you can give me a place file of it actually working? Because I’m having no luck.

I’m not too sure what kind of NPCs you need, but I know that rigs from ‘Build Rig’ won’t work, try using your avatar.

In ‘Studio Settings’ (FILE tab, top right corner), under ‘Studio’, should be default, scroll all the way to the bottom until you see a checkbox for ‘Show Pathfinding Links’ and make sure that it is set to true.

1 Like

I’ve tried my own character and how I got it is by using the moon animator character inserter. I tried R6 and R15 but they both don’t make a path. Why exactly does Build Rig not work?

I would usually make videos, but my computer isn’t cooperating with me at the moment. I took that script and parented it to a ‘Build Rig’ ‘Block Rig’ and then into one of these models I got from the Toolbox, I was using these rigs in one of my past games where I used PathFinding, and I found that, in your place, the toolbox rigs work and the ‘Build Rig’ doesn’t, but unfortunately the PathFindingLinks won’t work with any rig in your place. As a solution, I created a new place and copied the toolbox rig over and it was able to climb a truss, no problem.

Also, you have to delete some existing NPC scripts from the toolbox models, or it may mess up in PathFinding code you may try to run on it.

1 Like

Is this what it should look like?

I have removed the Pathfinding script from the NPC and made a script with the code that you have given before but it still seems to not make a path. Is it possible to just give a place file by saving a place as a .rblx file? I wonder why PathFindingLinks don’t work in my place.

Alright, here you go. Like I mentioned, only one rig will run, I recommend messing around and seeing if you can find out why. Also, if you didn’t notice, my script only make the NPC go to the spawn location, so if you want it to chase the player, you’ll have to write that part, but at least you have a script to make it climb ladders now. :grin:

PathFindingLinksTest.rbxl (62.5 KB)

2 Likes

Wow thank you so much for your help! It’s incredibly strange how your pathfinding link does seem to actually generate a path. When Show Navigation Mesh is turned on there are actually circles around your attachments while in my pathfinding link there aren’t any. Did you doing anything special to those attachments to get those circles? If not, then it’s probably a bug. Thank you for giving the place file so I’m actually able to have ladders now. :smile:

1 Like

Was this solved? If so then consider removing “[NOT SOLVED]” from the title.

1 Like

Glad it worked, for the attachments, there is a setting called Visible, set it to true to view the attachment.

1 Like

Thanks for reminding me! :laughing: I almost forgot about it.

1 Like

Hey, i got both rigs to work by anchoring the full model and then unanchoring it again and after that adding an “Animator” object into the Humanoid. It’s probably the unanchoring that fixed it but those are the steps I used. Edit: My place must be corrupted in some way because now I’m able to make actual functioning pathfinding links.

1 Like