New Pathfinding Modifiers - Studio Beta

While we’re on the subject of pathfinding, would we be able to get custom character sizes as well? Currently, it only works with regular-sized ones.

EDIT: It was already possible prior to this update with the PathfindingService:CreatePath method. My mistake.

1 Like


https://developer.roblox.com/en-us/api-reference/function/PathfindingService/CreatePath

2 Likes

Such a perfect time for this feature to be announced - Time to polish the NPCs pathfinding system I just started to create with these new modifiers! :smiley:

2 Likes

@MeaxisDev @Rocky28447
Any non-nil value can be used as a dictionary key. Even false, instances work, vectors, etc. And, recently, with the native Vector3 update, Vector3s (but not Vector2s yet) will work as table keys properly, so t[Vector3.new(1, 2, 3)] will always work, rather than being a whole new key each time the vector is created.

@MesmerizeDev Yes, you can replace 1.0 and math.huge with any values you want to (unless they are false or nil), its just an and/or chain. If canCrossDoor is true or any other truthy value you’ll get the value after the and, because the or comparison stops immediately once a truthy value is encountered. If its false (or nil), it simplifies to false or math.huge, so you get math.huge.

true and 1.0 or math.huge
true and 1.0 = 1.0
1.0 or math.huge = 1.0

false and 1.0 or math.huge
false and 1.0 = false
false or math.huge = math.huge

2 Likes

my bad, I don’t think it was covered in the announcement besides mentioning PathfindingModifiers

2 Likes

AgentRadius has existed since the addition of the CreatePath function

1 Like

Oh, last time I had looked up how to change agent size, this is what had come up in the search so I figured it wasn’t possible. Sorry for the confusion.

1 Like

Actually, this would be perfect for a navigation system, by giving roads a higher priority and only straying off the path when absolutely necessary. What a great use case!

That aside, this is an awesome update that brings much-needed usability to the existing Pathfinding API.

2 Likes

Another grand slam by Roblox!!!

This will greatly improve my development experience, and I’m gonna mess around with this even more later.

1 Like

This is great! Any chance we can get a JumpHeight in the near future too?

3 Likes

Strings should make it easier to reuse the annotations everywhere.
For example, you could have water on terrain and PathfindingModifiers with ModifierId="Water".
PathfindingService will give them the same treatment and prevents defining the cost twice (once for the material enum, and again for the modifier).
The idea is that Water means always the same, regardless of how it’s set during level design.

9 Likes

Hello, I cannot find any navigational areas/ meshes in my game, I have a big map and need pathfinding, how can I add/ fix these navigational areas/ meshes?

1 Like

more pathfinding updates are always welcome.

3 Likes

Maybe it has something to do with the custom materials that will probably come out by the end of this decade.

1 Like

I have a problems with Player Al when player cant path computed. I make jump over lava or gap with on platformer (obby course).


code:

local path = PathfindingService:CreatePath({
	AgentRadius = 2,
	AgentCanJump = True,
	Costs = {
		DangerZone = math.huge
	}
})

Thank.

3 Likes

Thank you for this, this has significantly enabled the ability to create pathfinding in places with NPC vehicles, cityscapes with NPCs only walking on sidewalks/crosswalks, direct AI control to prevent walking in places they shouldn’t, and more.
Many game features that were almost impossible to do so have now been made possible.

1 Like

Finally something useful lol. Thank you for this update!

1 Like

Thanks for the update! I been having fun!

I ran into a bug, the extra path seems to confuse the pathfinder.

5 Likes

wow i seen for the update, thank you for updated about modeifiers seen finally been used.

1 Like

This is great, plathforming ai is some thing I want to try out some time, and something I will be putting in my future game. If I do get to the point where I do my game the ai has to be able to react to the player and, find cover to fight back

Just a question, do you set up pathfinding through a script or is there some option I’ve never seen before. (Basically just get it set up and started, I know scripting is a big part of itl

1 Like