From 617b837772f5cf865fac5bdf2cd7b4071f0b22c7 Mon Sep 17 00:00:00 2001 From: Francois Belair Date: Wed, 15 Jan 2020 10:44:21 -0500 Subject: [PATCH] Fix bug with implementation of drag in Arrive Drag should inexorably draw towards 0, but when slow enough it could instead cause a reverse direction. --- project/demos/arrive/Arriver.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/demos/arrive/Arriver.gd b/project/demos/arrive/Arriver.gd index f582263..cfb028c 100644 --- a/project/demos/arrive/Arriver.gd +++ b/project/demos/arrive/Arriver.gd @@ -36,7 +36,7 @@ func _unhandled_input(event: InputEvent) -> void: func _physics_process(delta: float) -> void: _accel = _arrive.calculate_steering(_accel) _velocity += Vector2(_accel.linear.x, _accel.linear.y) - _velocity -= _velocity * _drag * delta + _velocity = _velocity.linear_interpolate(Vector2.ZERO, 0.1) _velocity = move_and_slide(_velocity) _update_agent()