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!
@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
my bad, I don’t think it was covered in the announcement besides mentioning PathfindingModifiers
AgentRadius has existed since the addition of the CreatePath function
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.
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.
Another grand slam by Roblox!!!
This will greatly improve my development experience, and I’m gonna mess around with this even more later.
This is great! Any chance we can get a JumpHeight in the near future too?
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.
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?
more pathfinding updates are always welcome.
Maybe it has something to do with the custom materials that will probably come out by the end of this decade.
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.
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.
Finally something useful lol. Thank you for this update!
Thanks for the update! I been having fun!
I ran into a bug, the extra path seems to confuse the pathfinder.
wow i seen for the update, thank you for updated about modeifiers seen finally been used.
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
Love what I’m seeing here.
With that said, do you guys have on the docket any future plans to improve nav mesh generation (or maybe support for custom ones)? Why I’m saying that is I was trying to stress test PathfindingService on a larger map, and it failed to move my NPC up a simple staircase with CanJump set to false.