diff --git a/modules/steering_ai/agents/gsai_kinematic_body_2d_agent.cpp b/modules/steering_ai/agents/gsai_kinematic_body_2d_agent.cpp index d729a8f08..da563bd20 100644 --- a/modules/steering_ai/agents/gsai_kinematic_body_2d_agent.cpp +++ b/modules/steering_ai/agents/gsai_kinematic_body_2d_agent.cpp @@ -86,7 +86,7 @@ void GSAIKinematicBody2DAgent::_apply_sliding_steering(const Vector3 &accel, con return; } - Vector2 velocity = GSAIUtils.to_vector2(linear_velocity + accel * delta).clamped(linear_speed_max); + Vector2 velocity = GSAIUtils.to_vector2(linear_velocity + accel * delta).limit_length(linear_speed_max); if (apply_linear_drag) { velocity = velocity.linear_interpolate(Vector2.ZERO, linear_drag_percentage);