diff --git a/godot/Demos/PursueSeek/Player.gd b/godot/Demos/PursueSeek/Player.gd index 8bc3588..3557c36 100644 --- a/godot/Demos/PursueSeek/Player.gd +++ b/godot/Demos/PursueSeek/Player.gd @@ -77,7 +77,7 @@ func _calculate_linear_velocity( var velocity := current_velocity + facing_direction * actual_strength * delta velocity = velocity.linear_interpolate(Vector2.ZERO, ship_drag_coefficient) - return velocity.clamped(speed_max) + return velocity.limit_length(speed_max) func _get_movement() -> Vector2: diff --git a/godot/Demos/PursueSeek/Pursuer.gd b/godot/Demos/PursueSeek/Pursuer.gd index 0425f98..1e4db40 100644 --- a/godot/Demos/PursueSeek/Pursuer.gd +++ b/godot/Demos/PursueSeek/Pursuer.gd @@ -41,7 +41,7 @@ func _physics_process(delta: float) -> void: GSAIUtils.to_vector2(agent.linear_velocity) + (GSAIUtils.angle_to_vector2(rotation) * -agent.linear_acceleration_max * delta) ) - linear_velocity = linear_velocity.clamped(agent.linear_speed_max) + linear_velocity = linear_velocity.limit_length(agent.linear_speed_max) linear_velocity = linear_velocity.linear_interpolate(Vector2.ZERO, _linear_drag_coefficient) linear_velocity = move_and_slide(linear_velocity) diff --git a/godot/Demos/Quickstart/Agent.gd b/godot/Demos/Quickstart/Agent.gd index 04a898f..c3cade1 100644 --- a/godot/Demos/Quickstart/Agent.gd +++ b/godot/Demos/Quickstart/Agent.gd @@ -146,7 +146,7 @@ func _physics_process(delta: float) -> void: # We add the discovered acceleration to our linear velocity. The toolkit does not limit # velocity, just acceleration, so we clamp the result ourselves here. - velocity = (velocity + Vector2(acceleration.linear.x, acceleration.linear.y) * delta).clamped( + velocity = (velocity + Vector2(acceleration.linear.x, acceleration.linear.y) * delta).limit_length( agent.linear_speed_max ) diff --git a/godot/Demos/Quickstart/Player.gd b/godot/Demos/Quickstart/Player.gd index 3a97a1e..7eb518d 100644 --- a/godot/Demos/Quickstart/Player.gd +++ b/godot/Demos/Quickstart/Player.gd @@ -48,7 +48,7 @@ func _physics_process(delta: float) -> void: direction = GSAIUtils.angle_to_vector2(rotation) velocity += direction * acceleration_max * movement * delta - velocity = velocity.clamped(speed_max) + velocity = velocity.limit_length(speed_max) velocity = velocity.linear_interpolate(Vector2.ZERO, 0.1) velocity = move_and_slide(velocity) diff --git a/godot/addons/com.gdquest.godot-steering-ai-framework/Agents/GSAIKinematicBody2DAgent.gd b/godot/addons/com.gdquest.godot-steering-ai-framework/Agents/GSAIKinematicBody2DAgent.gd index f697afc..7bd57c9 100644 --- a/godot/addons/com.gdquest.godot-steering-ai-framework/Agents/GSAIKinematicBody2DAgent.gd +++ b/godot/addons/com.gdquest.godot-steering-ai-framework/Agents/GSAIKinematicBody2DAgent.gd @@ -53,7 +53,7 @@ func _apply_sliding_steering(accel: Vector3, delta: float) -> void: if !_body.is_inside_tree() or _body.get_tree().paused: return - var velocity : Vector2 = GSAIUtils.to_vector2(linear_velocity + accel * delta).clamped(linear_speed_max) + var velocity : Vector2 = 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) diff --git a/godot/project.pandemonium b/godot/project.pandemonium index d7a40f0..cce6b16 100644 --- a/godot/project.pandemonium +++ b/godot/project.pandemonium @@ -162,7 +162,7 @@ window/stretch/aspect="expand" [editor_plugins] -enabled=PoolStringArray( "res://addons/gdc_converter/plugin.cfg" ) +enabled=PoolStringArray( ) [input]