#Multiple NavigationRegion3D for each unique enemy?

1 messages · Page 1 of 1 (latest)

gritty schooner
#

Morning All,

tldr: How do I create two different navigation meshes for 3D without duplicating my whole level and making it a child of two different NavigationRegions3Ds?

I have searched on google and this DC but no answers popped up. I have 2 enemies, one small and one very large, the smaller one can access areas the biger one can't. So I assume I have to create a navigation mesh for each and that's fine, how do I go about doing that without making a duplicate of my whole level for each NavigationRegion3D or is this the preferred way of doing it?
Edit: I shall now proceed to asking the ChatGPT, wish me luck.

Edit Edit: Ok found the solution:
-> Create a NavigationRegion3D for each unique enemy.
|-> Create new NavigationMesh.
|-> In the NavigationMesh properties go to Geometry.
|-> Change the Source Geometry Mode to Group With Children.
|-> Set the Source Group Name to your desired group name.
|-> Create a group with your desired name you entered into the Source Group Name.
|-> Assign all the level items you desire to be baked into the Navmesh to the group you just created.

Hope this helps someone else.

gentle tangle
#

That works but it parses the SceneTree nodes twice for every region which can be very slow. For performance it is even better if you parse only once with the NavigationServer3D.parse_source_geometry_data() function and then reuse the NavigationMeshSourceGeometryData3D to bake all your agent type navmeshes from the same data on threads using bake_from_source_geometry_data_async(). When the navmesh are baked, you can use the callbacks to get notified. At that point all you need to do is set the navmesh again on your NavigationRegion3D nodes to update the node including the node debug visuals.

gritty schooner
# gentle tangle That works but it parses the SceneTree nodes twice for every region which can be...

Holy crap ok that's cool, tbh I had to read that 3 times to make sure I understood. I'm going to try and do that in the c# script. Why is there so little tutorials on such a powerful system in Godot? ALL the video tutorials I found just skim over the most basic implementation. I know reading the docs is the best solution but having a tutorial explaining these thing does help like 70% of the user base doesn't it? Regardless of my ranting, thank you @gentle tangle for the advise!

gentle tangle
#

the official documentation has script examples for that

#

why tutorials and videos do not cover this, I dont know, maybe some even do, I am not aware of them. Barely finding time to keep the regular documentation updated.

gritty schooner
gentle tangle
#

I own all the typos in the official navigation documentation. Well ... most of them.