diff --git a/Assets/Scripts/Movement/FollowerController.cs b/Assets/Scripts/Movement/FollowerController.cs index 8b8cd6e8..b749fc8e 100644 --- a/Assets/Scripts/Movement/FollowerController.cs +++ b/Assets/Scripts/Movement/FollowerController.cs @@ -335,28 +335,19 @@ public class FollowerController: MonoBehaviour } OnPickupArrived?.Invoke(); - // Wait briefly, then return to player + // Brief pause at the item before returning yield return new WaitForSeconds(_interactionSettings.FollowerPickupDelay); - if (_aiPath != null && playerTransform != null) - { - _aiPath.maxSpeed = _followerMaxSpeed; - _aiPath.destination = playerTransform.position; - } - _isReturningToPlayer = true; - // Wait until follower returns to player (2D distance) - while (playerTransform != null && Vector2.Distance(new Vector2(transform.position.x, transform.position.y), new Vector2(playerTransform.position.x, playerTransform.position.y)) > _settings.StopThreshold) - { - yield return null; - } - _isReturningToPlayer = false; - OnPickupReturned?.Invoke(); + // Reset follower speed to normal after pickup _followerMaxSpeed = _defaultFollowerMaxSpeed; if (_aiPath != null) _aiPath.maxSpeed = _followerMaxSpeed; + + // Immediately resume normal following behavior _isManualFollowing = true; if (_aiPath != null) _aiPath.enabled = false; + _pickupCoroutine = null; } @@ -382,6 +373,16 @@ public class FollowerController: MonoBehaviour // Signal arrival OnPickupArrived?.Invoke(); + // Reset follower speed to normal after reaching the point + _followerMaxSpeed = _defaultFollowerMaxSpeed; + if (_aiPath != null) + _aiPath.maxSpeed = _followerMaxSpeed; + + // Immediately resume normal following behavior + _isManualFollowing = true; + if (_aiPath != null) + _aiPath.enabled = false; + _pickupCoroutine = null; }