New Pathfinding Modifiers - Studio Beta

Would this in the future support models?
Doesn’t seem to work out for me:


Only bounds to BaseParts (for now, hopefully):

Wondering why?

An example:

I could just place a Modifier in the model to avoid all BaseParts in that model.
Doesn’t work (Don’t mind the dummy, look at the path):

It would make it so much easier.
Instead of putting separate modifiers in each BasePart:

8 Likes

Yes, I needed this so much, I was almost going to do this in a very hacky way.
I can now finally make NPCs walk through doors, I needed this for so long.
Now we can finally make NPCs that walk on sidewalks of streets, go through doors, walk over bridges instead of attempting to swim and all that cool stuff.

I think this feature has been requested for years and it’s finally here, my day has been made. Today feels epic.

1 Like

This is starting to sound like minecraft’s baritone. It’s almost scary but so exiting to see that we could have realistic npc’s in our games now.

1 Like

Hell yeah that is very cool feature

1 Like

Negative costs are valid input values, and it’s ok to use them to annotate special objects, such as power-ups. But since the cost is multiplied by the traversed distance, you might run into a situation where longer paths with negative costs will be preferred over shorter alternatives. So in a practical sense, negative cost values are rewards.

8 Likes

Can we please have an agent parameter that can let us customise the height allowed for the AI to jump? Because in a lot of scenarios the AI cannot jump over a tall wall, despite the AI having high jump power.

11 Likes

This would work great with AI Vehicles!

2 Likes

Thank you, this makes a lot of sense :smile:

Unfortunately, based on the following quote from a reply above, it doesn’t sound like negative cost values work as described. I would assume, if this is accurate, this is likely either a bug or an oversight due to negative costs being unexpected.

2 Likes

Is it intended that ModifierID and PassThrough values on PathfindingModifiers don’t save (they just reset) if I exit the studio?

1 Like

Yeah. This happened to me. I wanted to create a footpath that my AIs would prefer walk on (rather than the dirt) and then I went to test it, and then nothing happened. And then when I stopped running the game, studio stopped responding.

1 Like

Thank you, this is a great addition to Pathfinding.

Will you support functionality of Modifiers to work with Models as well? I think it’s impractical and poorly designed if this is to only work with Baseparts because it is tedious and time consuming to add them into every Part instead of a few Models

In general we’d want to have our entire model have a single modifier for all Parts in it if we choose to do so, it would improve UX and QOL.

3 Likes

Oh my! That’s a great update, can’t wait to test it out right now! :sunny:

3 Likes

YESS FINALLY AI CAN TRAVEL THROUGH DOORS!
No more getting stuck in rooms!!

4 Likes

Woow, roblox u just made amazing thing, i think is very cool and usefull!

1 Like

I just loved it!!! I’m working in a city-style game where NPCs should walk around the city and use crosswalks, It’s really amazing.

1 Like

This is also very useful if you are creating buildings in blender. You can block off navmesh errors which are caused by thin walls. Just solved the issue of mobs trying to pathfind through building walls by using kill brick example to block off thin walls and crosswalk exaple to set an easy path in and out of building. I also set pathfinding weights for other materials so mobs prefer to walk on crosswalks.

1 Like

When I try to recreate the door example, I get a warning saying that the passthrough property isn’t supported?

My code:

local pathService = game:GetService("PathfindingService")
local endGoal = workspace.Goal

local doorVolume = workspace.DoorVolume

local modifier = Instance.new("PathfindingModifier")
modifier.ModifierId = "Door"
modifier.Name = "PathfindingModifier"
modifier.Parent = doorVolume

doorVolume.PathfindingModifier.ModifierId = "Door"
doorVolume.PathfindingModifier.PassThrough = true

function createPath(goal)
	local canCrossDoor = true
	local agentParameters = {
		Costs = {
			Door = canCrossDoor and 1.0 or math.huge
		}
	}
	
	local path = pathService:CreatePath(agentParameters)
	path:ComputeAsync(script.Parent.HumanoidRootPart.Position, goal.Position)
	
	local waypoints = path:GetWaypoints()
	for i, point in pairs(waypoints) do
		script.Parent.Humanoid:MoveTo(point.Position)
		
		script.Parent.Humanoid.MoveToFinished:Wait()
	end
end

wait(2)
createPath(endGoal)

Very cool feature btw! Glad that roblox is taking steps forward to improve the pathfinding system for us!

EDIT:

Found out it was because I didn’t restart studio lol

1 Like

Can you guys on ROBLOX support your pathfinding system to climb truss parts as well?
it would be nice if NPCs would be able to climb trusses and ladders while pathfinding when it is supported by roblox and not by 3rd party algorithms. It is good for zombie and shooting games.

1 Like

its probably because you have enabled all beta features. I had the same problem and to fix it i had to turn off all beta features and turn on only the PathfindingModifiers feature.

Anything in the works for adding links between locations, for example if it was set up using 2 attachments/parts with a Cost paramter and a oneway option.

Path:ComputeAsync() could then return that link as a waypoint which then allows the developer to carry out custom actions, for example Teleport or Climb.