unity3d – modify this code to make the player move only when the button is held down UNITY 3D

When pressing the move button once, the character continues to move without stopping, except when pressing another button
I want to modify this code to make the player move only when the button is held down

public void Move(Vector3 velocity, bool standingOnPlatform)
    {
        Move(velocity, Vector2.zero, standingOnPlatform);
    }

    public void Move(Vector3 velocity, Vector2 input, bool standingOnPlatform = false, bool isPlayer = false)
    {

        UpdateRaycastOrigins();
        isBelowOld = collisions.below;

        collisions.Reset();
        collisions.velocityOld = velocity;
        playerInput = input;

        if (velocity.x != 0)
        {
            collisions.faceDir = (int)Mathf.Sign(velocity.x);
        }

        if (velocity.y < 0)
        {
            DescendSlope(ref velocity);
        }

        if (HandlePhysic)
        {
            HorizontalCollisions(ref velocity);
            if (velocity.y != 0)
            {
                VerticalCollisions(ref velocity);
            }
        }

        if (collisions.left || collisions.right)
            velocity.x = 0;

        transform.Translate(velocity, Space.World);

        if (standingOnPlatform)
        {
            collisions.below = true;
        }
    }

modify this code to make the player move only when the button is held down

Read more here: Source link