From 6d8e5773cc94d30c2f3617444ac26c132425e463 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 13 Jan 2023 23:19:29 +0100 Subject: [PATCH] Small fix. --- modules/steering_ai/agents/gsai_kinematic_body_2d_agent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);