Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavMesh source geometry parsing ignores CSGShape3D set to use_collision #79843

Closed
smix8 opened this issue Jul 24, 2023 · 2 comments · Fixed by #79643
Closed

NavMesh source geometry parsing ignores CSGShape3D set to use_collision #79843

smix8 opened this issue Jul 24, 2023 · 2 comments · Fixed by #79643
Assignees
Milestone

Comments

@smix8
Copy link
Contributor

smix8 commented Jul 24, 2023

Godot version

Godot 4.1

System information

Windows 10

Issue description

The source geometry parsing for the navigation mesh baking only adds mesh geometry from CSGShape3D when set to NavigationMesh::PARSED_GEOMETRY_MESH_INSTANCES or PARSED_GEOMETRY_BOTH.

The parsing ignores CSG shapes with use_collision enabled when set to PARSED_GEOMETRY_STATIC_COLLIDERS.
The parsing also ignores the collision_layers bitmask in all cases.

Steps to reproduce

Add CSGShape3D with use_collision enabled and set the NavigationMesh to PARSED_GEOMETRY_STATIC_COLLIDERS.

Minimal reproduction project

N/A

@venilark
Copy link

venilark commented Aug 2, 2023

When doing
NavigationServer3D.bake_from_source_geometry_data()
I always get "NavigationMeshSourceGeometryData3D is empty. Parse source geometry first."
I used the callable from parse_source_geometry_data() and tried with both Static Colliders and Mesh Instances

Tried with the CSGCombiner, same as you. If I add a StaticBody the error disappears because it finally finds some geometry but if there are only CSGs in neither mode I get anything.

@smix8
Copy link
Contributor Author

smix8 commented Aug 3, 2023

As mentioned in the other open issue the problem in venilark's project was that the parsing was done in a _ready() function.

The SceneTree is not done with all the nodes setups when a _ready() function in a node gets called, use call_deferred(). Some node types like TileMap or GridMap do their setups deferred themself so you need to wait a frame for them to be truly ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants