Open peter-rocchio opened 1 year ago
This error is unrelated to navigation.
VisibleOnScreenEnabler2D
disables the node's processing mode.So what you can do in your own scripts is to check the process mode / physics space first to guard against the error.
What imo physics can do long-term is to work with a real enable/disable toggle or pause modes. Right now it goes the lazy way of removing RIDs or disabling entire server processing when paused which causes all kinds of issues. Navigation had many of the same issues (e.g. agents were removed from maps instead of just paused) before the enabled modes were added.
This error is unrelated to navigation.
- The
VisibleOnScreenEnabler2D
disables the node's processing mode.- A physics node with disabled processing mode gets its physics space removed.
- move_and_slide() will trigger an error with no physics space.
So what you can do in your own scripts is to check the process mode / physics space first to guard against the error.
What imo physics can do long-term is to work with a real enable/disable toggle or pause modes. Right now it goes the lazy way of removing RIDs or disabling entire server processing when paused which causes all kinds of issues. Navigation had many of the same issues (e.g. agents were removed from maps instead of just paused) before the enabled modes were added.
Thank you for clarifying, and thank you for the navigation system. It's been a pleasure to use and I look forward to all the new features on the way.
Godot version
v4.1.2.stable.official [399c9dc39]
System information
Windows 11, Vulkan
Issue description
When a VisibleOnScreenEnabler2D is paired with a CharacterBody2D using avoidance on a NavigationAgent2D the velocity_computed signal generates and error if attempting to set the velocity and call move_and_slide.
The error is:
In the attached minimal reproduction project this error occurs only once, however in a different project this error happens every frame if more than 1 of the same agent is in the scene.
Steps to reproduce
Minimal reproduction project
NavAgentSafeVelocity.zip