Крч просто добавь методы с продолжительным движением в этот файл по типу ForwardContinuousMovement StopContinuousMovement

using UnityEngine;
using System.Collections;

public class MoveHandBasePosition : MonoBehaviour
{
    [Header("Boundary Points")]
    public Transform forwardPoint;  // Максимальное положение вперед (по Y)
    public Transform backwardPoint; // Начальное положение (по Y)
    public Transform rightPoint;   // Максимальное положение вправо (по X)
    public Transform leftPoint;    // Начальное положение (по X)

    [Header("Settings")]
    public float moveSpeed = 3f;
    public float moveDuration = 1f;
    
    [Header("Debug")]
    [SerializeField] private Vector2 _currentPosition; // X: 0 (left) to 1 (right), Y: 0 (back) to 1 (forward)
    
    // Состояния для каждой оси
    public enum AxisState { AtStart, Moving, AtEnd }
    public AxisState XState { get; private set; } = AxisState.AtStart;
    public AxisState YState { get; private set; } = AxisState.AtStart;

    void Start()
    {
        _currentPosition = Vector2.zero;
        InitializeComponents();
        UpdateStates();
    }

    void InitializeComponents()
    {
        if (!TryGetComponent(out Collider col))
        {
            col = gameObject.AddComponent<BoxCollider>();
            ((BoxCollider)col).size = new Vector3(1f, 1f, 1f);
        }
        col.isTrigger = false;

        if (!TryGetComponent(out Rigidbody rb))
        {
            rb = gameObject.AddComponent<Rigidbody>();
            rb.isKinematic = true;
            rb.useGravity = false;
        }
    }

    void UpdateStates()
    {
        // Обновляем состояние оси X
        XState = _currentPosition.x <= 0.01f ? AxisState.AtStart :
                _currentPosition.x >= 0.99f ? AxisState.AtEnd :
                AxisState.Moving;

        // Обновляем состояние оси Z
        YState = _currentPosition.y <= 0.01f ? AxisState.AtStart :
                _currentPosition.y >= 0.99f ? AxisState.AtEnd :
                AxisState.Moving;
    }

    public void MoveForwardStart()
    {
        if (YState != AxisState.AtEnd && YState != AxisState.Moving)
            StartCoroutine(MoveCoroutine(new Vector3(transform.position.x, transform.position.y, forwardPoint.position.z), true));
    }

    public void MoveBackwardStart()
    {
        if (YState != AxisState.AtStart && YState != AxisState.Moving)
            StartCoroutine(MoveCoroutine(new Vector3(transform.position.x, transform.position.y, backwardPoint.position.z), false));
    }

    public void MoveRightStart()
    {
        if (XState != AxisState.AtStart && XState != AxisState.Moving)
            StartCoroutine(MoveCoroutine(new Vector3(rightPoint.position.x, transform.position.y, transform.position.z), false));
    }

    public void MoveLeftStart()
    {
        if (XState != AxisState.AtEnd && XState != AxisState.Moving)
            StartCoroutine(MoveCoroutine(new Vector3(leftPoint.position.x, transform.position.y, transform.position.z), true));
    }

    private IEnumerator MoveCoroutine(Vector3 targetPos, bool isIncreasing)
    {
        // Устанавливаем состояние в Moving для соответствующей оси
        if (targetPos.x != transform.position.x) XState = AxisState.Moving;
        if (targetPos.z != transform.position.z) YState = AxisState.Moving;

        float elapsed = 0f;
        Vector3 startPos = transform.position;

        while (elapsed < moveDuration)
        {
            transform.position = Vector3.Lerp(startPos, targetPos, elapsed / moveDuration);
            elapsed += Time.deltaTime;
            yield return null;
        }

        transform.position = targetPos;

        // Обновляем позицию и состояние
        if (targetPos.x != startPos.x)
        {
            _currentPosition.x = Mathf.Clamp01(_currentPosition.x + (isIncreasing ? 1f : -1f));
        }
        else if (targetPos.z != startPos.z)
        {
            _currentPosition.y = Mathf.Clamp01(_currentPosition.y + (isIncreasing ? 1f : -1f));
        }

        UpdateStates();
    }

    // Публичные свойства для удобного доступа
    public float LeftRightPosition => _currentPosition.x; // 0 = left, 1 = right
    public float ForwardBackPosition => _currentPosition.y; // 0 = back, 1 = forward

    void OnDrawGizmosSelected()
    {
        // Ось Z (вперед-назад)
        if (forwardPoint && backwardPoint)
        {
            Gizmos.color = Color.blue;
            Gizmos.DrawLine(backwardPoint.position, forwardPoint.position);
            
            Gizmos.color = Color.cyan;
            Gizmos.DrawSphere(forwardPoint.position, 0.05f);
            Gizmos.DrawSphere(backwardPoint.position, 0.05f);
        }

        // Ось X (влево-вправо)
        if (leftPoint && rightPoint)
        {
            Gizmos.color = Color.red;
            Gizmos.DrawLine(leftPoint.position, rightPoint.position);
            
            Gizmos.color = Color.magenta;
            Gizmos.DrawSphere(leftPoint.position, 0.05f);
            Gizmos.DrawSphere(rightPoint.position, 0.05f);
        }
    }
}