Skip to content

NavigationRegion3D saved "disabled" don't work when enabled in script #83364

Closed
@Malcolmnixon

Description

Godot version

4.2-beta.1

System information

Windows 11, Vulkan Mobile, NVidia RTX 3070 TI

Issue description

I have numerous "bridges" (meshes with NavigationRegion3D) that start life disabled (NavigationRegion3D.enabled = false).

In Godot 4.1 I could enable these bridges in script when the player triggered an action, and the NavigationRegion3D would correctly enable with edge connections allowing NPCs to walk across the bridge.

In Godot 4.2 if the NavigationRegion3D is saved disabled then enabling/disabling fails to enable edge connections. I suspect the bug may have been introduced by #77191 in NavigationRegion3D::_region_enter_navigation_map. This function only registers the region with the world-map if the region is enabled when it enters the tree. Enabling at a later time does not register the region.

Steps to reproduce

Attached is a simple demo project. When loaded the main scene shows the following three navigation regions and their edge connections:
image

Toggling the enable on region 1 works as expected:
image

Save the scene with region 1 disabled; then close and reopen it:
image

Toggling the enable on region 1 fails to enable the edge connections:
image

Minimal reproduction project

NavRegionDisabledBug.zip

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions