summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-07-03 15:26:14 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-07-03 15:26:14 +0200
commit2926ddec1c07b9343f12f82d49dc28f6a9954111 (patch)
tree706065599068a28d1e4c11841b92f10309b564e5
parent813ff4b460eaf73f9cd59d734a7d2cd361313a49 (diff)
parentfcbb5213922829817b6ee76a15f1e4f7519b51d6 (diff)
downloadredot-engine-2926ddec1c07b9343f12f82d49dc28f6a9954111.tar.gz
Merge pull request #78939 from Scony/navi-crash-fix
Fix crash in `NavigationAgent3D`
-rw-r--r--scene/3d/navigation_agent_3d.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp
index 6ce63d9a4e..93acf38fa8 100644
--- a/scene/3d/navigation_agent_3d.cpp
+++ b/scene/3d/navigation_agent_3d.cpp
@@ -220,7 +220,7 @@ void NavigationAgent3D::_notification(int p_what) {
set_agent_parent(get_parent());
set_physics_process_internal(true);
- if (avoidance_enabled) {
+ if (agent_parent && avoidance_enabled) {
NavigationServer3D::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin);
}