Backported from godot4: Fix crash in 'NavigationAgent3D', fixes #78910

- Scony
fcbb521392
This commit is contained in:
Relintai 2023-09-02 13:28:16 +02:00
parent 62c5bfbc36
commit d5499c69ba

View File

@ -205,7 +205,7 @@ void NavigationAgent::_notification(int p_what) {
set_agent_parent(get_parent()); set_agent_parent(get_parent());
set_physics_process_internal(true); set_physics_process_internal(true);
if (avoidance_enabled) { if (agent_parent && avoidance_enabled) {
NavigationServer::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin); NavigationServer::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin);
} }