mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-22 03:46:50 +01:00
Backported from godot4: Fix NavigationAgent continues avoidance velocity
Fixes NavigationAgent continues avoidance velocity.
- smix8
c912df9d05
This commit is contained in:
parent
5a758b5c1e
commit
397a9e9bcd
@ -826,6 +826,11 @@ void NavigationAgent2D::update_navigation() {
|
||||
nav_path_index -= 1;
|
||||
navigation_finished = true;
|
||||
target_position_submitted = false;
|
||||
if (avoidance_enabled) {
|
||||
Navigation2DServer::get_singleton()->agent_set_position(agent, agent_parent->get_global_position());
|
||||
Navigation2DServer::get_singleton()->agent_set_velocity(agent, Vector2(0.0, 0.0));
|
||||
Navigation2DServer::get_singleton()->agent_set_velocity_forced(agent, Vector2(0.0, 0.0));
|
||||
}
|
||||
emit_signal("navigation_finished");
|
||||
break;
|
||||
}
|
||||
|
@ -808,6 +808,11 @@ void NavigationAgent::update_navigation() {
|
||||
nav_path_index -= 1;
|
||||
navigation_finished = true;
|
||||
target_position_submitted = false;
|
||||
if (avoidance_enabled) {
|
||||
NavigationServer::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin);
|
||||
NavigationServer::get_singleton()->agent_set_velocity(agent, Vector3(0.0, 0.0, 0.0));
|
||||
NavigationServer::get_singleton()->agent_set_velocity_forced(agent, Vector3(0.0, 0.0, 0.0));
|
||||
}
|
||||
emit_signal("navigation_finished");
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user