godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.08k stars 21.18k forks source link

NavigationPolygon uses 3D parsed_collision_mask and ignore other tilemap physics layers #90125

Closed Prakkkmak closed 7 months ago

Prakkkmak commented 7 months ago

Tested versions

4.2.1.stable

System information

Windows 11

Issue description

NavigationRegion2D uses a NavigationPolygon. This Polygon refers to 3D Collision Masks. The problem is, in my tilemap I can't set physics 3D layers so my "Bake Navigation Polygon" don't work properly. -> My guess is: the NavigationPolygon filters only the first collision layer. If the first physics layer of the tilemap is set to 4 for example and the navpolygon to 4, it's works. But if the second layer was in the physics 4, the the layer will be ignored.

Steps to reproduce

Create a NavigationPolygon The Parsed Collision Mask refers to 3d Physics and not the 2D physics layers

Minimal reproduction project (MRP)

test_nav.zip

smix8 commented 7 months ago

The NavigationPolygon group name for the parsing and the layer name had a bug in Godot 4.2.1. It is fixed in Godot 4.3dev / master.

The 2D navigation mesh baking only parses the TileMapLayer0. See other issue https://github.com/godotengine/godot/issues/85798.

smix8 commented 7 months ago

Closing as the group name has been fixed in Godot master and the parsing now considers all TileMapLayers with PR https://github.com/godotengine/godot/pull/85856.

Even with all TileMapLayers parsed the core navigationmesh restrictions still apply. This means that tile polygons can not overlap and intersect.