From d5499c69ba76504b41e93886608bbece3cea0638 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 2 Sep 2023 13:28:16 +0200 Subject: [PATCH] Backported from godot4: Fix crash in 'NavigationAgent3D', fixes #78910 - Scony https://github.com/godotengine/godot/commit/fcbb5213922829817b6ee76a15f1e4f7519b51d6 --- scene/3d/navigation_agent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/navigation_agent.cpp b/scene/3d/navigation_agent.cpp index 4400b756b..4d2e4177e 100644 --- a/scene/3d/navigation_agent.cpp +++ b/scene/3d/navigation_agent.cpp @@ -205,7 +205,7 @@ void NavigationAgent::_notification(int p_what) { set_agent_parent(get_parent()); 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); }