Merge pull request #78939 from Scony/navi-crash-fix

Fix crash in `NavigationAgent3D`
This commit is contained in:
Rémi Verschelde 2023-07-03 15:26:14 +02:00
commit 2926ddec1c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -220,7 +220,7 @@ void NavigationAgent3D::_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) {
NavigationServer3D::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin); NavigationServer3D::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin);
} }