'Two Problems Concerning Unity Input System

I'm new to Unity and ive been trying to work with the new input manager but ive come across two new problems firstly, when trying to make the movement buttons using the 2D composite if i put the button type on Value and i press any button the animation keeps playing even when i remove the button.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class RiderPl : MonoBehaviour
{
    Animator animator;
    bool Fwd;
    bool Jmp;
    bool Tnt;
    bool KCK;
    int IsKickingHash;
    int IsWalkingHash;
    int IsJumpingHash;
    int LetsTauntHash;
    Vector2 GetPos;
    ContolSystem control;
    CharacterController controller;
    // Start is called before the first frame update
    void Start()
    {
        animator = GetComponent<Animator>();
        controller = GetComponent<CharacterController>();

        IsWalkingHash = Animator.StringToHash("IsWalking");
        IsJumpingHash = Animator.StringToHash("IsJumping");
        LetsTauntHash = Animator.StringToHash("LetsTaunt");
        IsKickingHash = Animator.StringToHash("IsKicking");
    }

    void Awake()
    {

        control = new ContolSystem();

        control.Box.Movement.performed += ctx =>
        {
            GetPos = ctx.ReadValue<Vector2>();
            Fwd = GetPos.x !=0 || GetPos.y !=0;
        };

        control.Box.Jump.performed += ctx => Jmp = ctx.ReadValueAsButton();
        control.Box.Taunt.performed += ctx => Tnt = ctx.ReadValueAsButton();
        control.Box.Kick.performed += ctx => KCK = ctx.ReadValueAsButton();
    }

    // Update is called once per frame
    void Update()
    {
        HandleMovement();
    }

    void HandleMovement()
    {
        bool IsWalking = animator.GetBool(IsWalkingHash);
        bool IsJumping = animator.GetBool(IsJumpingHash);
        bool LetsTaunt = animator.GetBool(LetsTauntHash);
        bool IsKicking = animator.GetBool(IsKickingHash);

        if (Fwd && !IsWalking)
        {
            animator.SetBool(IsWalkingHash, true);
        }

        if (!Fwd && IsWalking)
        {
            animator.SetBool(IsWalkingHash, false);
        }

        if (Jmp && !IsJumping)
        {
            animator.SetBool(IsJumpingHash, true);
        }

        if (!Jmp && IsJumping)
        {
            animator.SetBool(IsJumpingHash, false);
        }

        if (Tnt && !LetsTaunt)
        {
            animator.SetBool(LetsTauntHash, true);
        }

        if (!Tnt && LetsTaunt)
        {
            animator.SetBool(LetsTauntHash, false);
        }

        if (KCK && !IsKicking)
        {
            animator.SetBool(IsKickingHash, true);
        }

        if (!KCK && IsKicking)
        {
            animator.SetBool(IsKickingHash, false);
        }
    }

    void HandleRotation()
    {
        Vector3 currentPosition = transform.position;

        Vector3 newPosition = new Vector3(GetPos.x, 0, GetPos.y);

        Vector3 positionToLookAt= newPosition + currentPosition;

        transform.LookAt(positionToLookAt);
    }

    void OnEnable()
    {
        control.Box.Enable();
    }

    void OnDisable()
    {
        control.Box.Disable();
    }
}

Then Secondly i would like to know how to make my animation move around all axis and not just the X axis

// GENERATED AUTOMATICALLY FROM 'Assets/ContolSystem.inputactions'

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;

public class @ContolSystem : IInputActionCollection, IDisposable
{
    public InputActionAsset asset { get; }
    public @ContolSystem()
    {
        asset = InputActionAsset.FromJson(@"{
    ""name"": ""ContolSystem"",
    ""maps"": [
        {
            ""name"": ""Box"",
            ""id"": ""684263c5-5c0a-44f6-b00b-882c01a17081"",
            ""actions"": [
                {
                    ""name"": ""Movement"",
                    ""type"": ""PassThrough"",
                    ""id"": ""1f6d74ed-f20e-4881-8e1b-c7333aba4ee4"",
                    ""expectedControlType"": ""Vector2"",
                    ""processors"": """",
                    ""interactions"": """"
                },
                {
                    ""name"": ""Jump"",
                    ""type"": ""Button"",
                    ""id"": ""c2638990-76f7-4818-ab63-cce9b2543808"",
                    ""expectedControlType"": ""Button"",
                    ""processors"": """",
                    ""interactions"": ""Press(behavior=2)""
                },
                {
                    ""name"": ""Taunt"",
                    ""type"": ""Button"",
                    ""id"": ""ac06e101-78af-49fe-9452-d8d54eb67d6e"",
                    ""expectedControlType"": ""Button"",
                    ""processors"": """",
                    ""interactions"": ""Tap""
                },
                {
                    ""name"": ""Kick"",
                    ""type"": ""Button"",
                    ""id"": ""7654a530-feb6-4b92-a725-4268e3b00eba"",
                    ""expectedControlType"": ""Button"",
                    ""processors"": """",
                    ""interactions"": ""Press""
                }
            ],
            ""bindings"": [
                {
                    ""name"": ""WASD"",
                    ""id"": ""f08813c4-1f75-4023-962d-6a9ca7679179"",
                    ""path"": ""2DVector"",
                    ""interactions"": """",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Movement"",
                    ""isComposite"": true,
                    ""isPartOfComposite"": false
                },
                {
                    ""name"": ""up"",
                    ""id"": ""d1a61d34-6350-4b7b-a4ef-a43dcb3edd34"",
                    ""path"": ""<Keyboard>/w"",
                    ""interactions"": """",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Movement"",
                    ""isComposite"": false,
                    ""isPartOfComposite"": true
                },
                {
                    ""name"": ""down"",
                    ""id"": ""69e2cc95-5ff5-4507-acb8-91a69041e7f7"",
                    ""path"": ""<Keyboard>/s"",
                    ""interactions"": """",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Movement"",
                    ""isComposite"": false,
                    ""isPartOfComposite"": true
                },
                {
                    ""name"": ""left"",
                    ""id"": ""7b5084b2-af15-422b-96f7-75c3b0462b03"",
                    ""path"": ""<Keyboard>/a"",
                    ""interactions"": """",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Movement"",
                    ""isComposite"": false,
                    ""isPartOfComposite"": true
                },
                {
                    ""name"": ""right"",
                    ""id"": ""01220751-f0e4-4c9d-bcd1-bb51706bd028"",
                    ""path"": ""<Keyboard>/d"",
                    ""interactions"": """",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Movement"",
                    ""isComposite"": false,
                    ""isPartOfComposite"": true
                },
                {
                    ""name"": """",
                    ""id"": ""d5bb3203-0b26-46fd-b7fa-19f9d187f763"",
                    ""path"": ""<Keyboard>/q"",
                    ""interactions"": """",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Jump"",
                    ""isComposite"": false,
                    ""isPartOfComposite"": false
                },
                {
                    ""name"": """",
                    ""id"": ""cfdc86e5-754b-4d82-a6d0-a9fef24a1402"",
                    ""path"": ""<Keyboard>/c"",
                    ""interactions"": ""Press(behavior=2)"",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Taunt"",
                    ""isComposite"": false,
                    ""isPartOfComposite"": false
                },
                {
                    ""name"": """",
                    ""id"": ""2efc0bbb-4f2c-4100-a043-2abc535cf6fb"",
                    ""path"": ""<Keyboard>/z"",
                    ""interactions"": ""Press(behavior=2)"",
                    ""processors"": """",
                    ""groups"": """",
                    ""action"": ""Kick"",
                    ""isComposite"": false,
                    ""isPartOfComposite"": false
                }
            ]
        }
    ],
    ""controlSchemes"": []
}");
        // Box
        m_Box = asset.FindActionMap("Box", throwIfNotFound: true);
        m_Box_Movement = m_Box.FindAction("Movement", throwIfNotFound: true);
        m_Box_Jump = m_Box.FindAction("Jump", throwIfNotFound: true);
        m_Box_Taunt = m_Box.FindAction("Taunt", throwIfNotFound: true);
        m_Box_Kick = m_Box.FindAction("Kick", throwIfNotFound: true);
    }

    public void Dispose()
    {
        UnityEngine.Object.Destroy(asset);
    }

    public InputBinding? bindingMask
    {
        get => asset.bindingMask;
        set => asset.bindingMask = value;
    }

    public ReadOnlyArray<InputDevice>? devices
    {
        get => asset.devices;
        set => asset.devices = value;
    }

    public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;

    public bool Contains(InputAction action)
    {
        return asset.Contains(action);
    }

    public IEnumerator<InputAction> GetEnumerator()
    {
        return asset.GetEnumerator();
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
        return GetEnumerator();
    }

    public void Enable()
    {
        asset.Enable();
    }

    public void Disable()
    {
        asset.Disable();
    }

    // Box
    private readonly InputActionMap m_Box;
    private IBoxActions m_BoxActionsCallbackInterface;
    private readonly InputAction m_Box_Movement;
    private readonly InputAction m_Box_Jump;
    private readonly InputAction m_Box_Taunt;
    private readonly InputAction m_Box_Kick;
    public struct BoxActions
    {
        private @ContolSystem m_Wrapper;
        public BoxActions(@ContolSystem wrapper) { m_Wrapper = wrapper; }
        public InputAction @Movement => m_Wrapper.m_Box_Movement;
        public InputAction @Jump => m_Wrapper.m_Box_Jump;
        public InputAction @Taunt => m_Wrapper.m_Box_Taunt;
        public InputAction @Kick => m_Wrapper.m_Box_Kick;
        public InputActionMap Get() { return m_Wrapper.m_Box; }
        public void Enable() { Get().Enable(); }
        public void Disable() { Get().Disable(); }
        public bool enabled => Get().enabled;
        public static implicit operator InputActionMap(BoxActions set) { return set.Get(); }
        public void SetCallbacks(IBoxActions instance)
        {
            if (m_Wrapper.m_BoxActionsCallbackInterface != null)
            {
                @Movement.started -= m_Wrapper.m_BoxActionsCallbackInterface.OnMovement;
                @Movement.performed -= m_Wrapper.m_BoxActionsCallbackInterface.OnMovement;
                @Movement.canceled -= m_Wrapper.m_BoxActionsCallbackInterface.OnMovement;
                @Jump.started -= m_Wrapper.m_BoxActionsCallbackInterface.OnJump;
                @Jump.performed -= m_Wrapper.m_BoxActionsCallbackInterface.OnJump;
                @Jump.canceled -= m_Wrapper.m_BoxActionsCallbackInterface.OnJump;
                @Taunt.started -= m_Wrapper.m_BoxActionsCallbackInterface.OnTaunt;
                @Taunt.performed -= m_Wrapper.m_BoxActionsCallbackInterface.OnTaunt;
                @Taunt.canceled -= m_Wrapper.m_BoxActionsCallbackInterface.OnTaunt;
                @Kick.started -= m_Wrapper.m_BoxActionsCallbackInterface.OnKick;
                @Kick.performed -= m_Wrapper.m_BoxActionsCallbackInterface.OnKick;
                @Kick.canceled -= m_Wrapper.m_BoxActionsCallbackInterface.OnKick;
            }
            m_Wrapper.m_BoxActionsCallbackInterface = instance;
            if (instance != null)
            {
                @Movement.started += instance.OnMovement;
                @Movement.performed += instance.OnMovement;
                @Movement.canceled += instance.OnMovement;
                @Jump.started += instance.OnJump;
                @Jump.performed += instance.OnJump;
                @Jump.canceled += instance.OnJump;
                @Taunt.started += instance.OnTaunt;
                @Taunt.performed += instance.OnTaunt;
                @Taunt.canceled += instance.OnTaunt;
                @Kick.started += instance.OnKick;
                @Kick.performed += instance.OnKick;
                @Kick.canceled += instance.OnKick;
            }
        }
    }
    public BoxActions @Box => new BoxActions(this);
    public interface IBoxActions
    {
        void OnMovement(InputAction.CallbackContext context);
        void OnJump(InputAction.CallbackContext context);
        void OnTaunt(InputAction.CallbackContext context);
        void OnKick(InputAction.CallbackContext context);



    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source