Animation not starting

Hello!

I’ve been working on my first Mobile Game and I’m using animations to make my car change lanes. It’s working perfectly until I stumbled upon this unexplainable problem. Basically I tell the animation to play depending on the keycode pressed and the last animation played. I can change lanes from right then left but when I change lanes to the left one I can’t go back to the middle lane. I’ll post some screenshots. I don’t know what the problem is as the code seems to be correct. Thank you!

Code:

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

public class PlayAnimation : MonoBehaviour
{
    private Animator animator;
    private bool isAnimatingLeft = false;
    private bool isAnimatingRight = false;
    private bool isAnimatingRightLeft = false;
    private bool isAnimatingLeftRight = false;
    private bool isIdle = true;

    private void Start()
    {
         animator = GetComponent<Animator>();
        
    }

    private void Update()
    {
        if(Input.GetKeyDown(KeyCode.LeftArrow) && isIdle)
        {
            animator.SetBool("isIdle", false);
            isIdle = false;
            animator.SetBool("isAnimatingLeft", true);
            isAnimatingLeft = true;
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow) && isAnimatingRightLeft)
        {
            animator.SetBool("isAnimatingRightLeft", false);
            isAnimatingRightLeft = false;
            animator.SetBool("isAnimatingLeft", true);
            isAnimatingLeft = true;
        }

        if (Input.GetKeyDown(KeyCode.RightArrow) && isIdle)
        {
            animator.SetBool("isIdle", false);
            isIdle = false;
            animator.SetBool("isAnimatingRight", true);
            isAnimatingRight = true;
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow) && isAnimatingRight)
        {
            animator.SetBool("isAnimatingRight", false);
            isAnimatingRight = false;
            animator.SetBool("isAnimatingRightLeft", true);
            isAnimatingRightLeft = true;
        }

        if (Input.GetKeyDown(KeyCode.RightArrow) && isAnimatingLeft)
        {
            animator.SetBool("isAnimatingLeft", false);
            isAnimatingLeft = false;
            animator.SetBool("isAnimatingLeftRight", true);
            isAnimatingLeftRight = true;
        }

        if (Input.GetKeyDown(KeyCode.RightArrow) && isAnimatingRightLeft)
        {
            animator.SetBool("isAnimatingRightLeft", false);
            isAnimatingRightLeft = false;
            animator.SetBool("isAnimatingRight", true);
            isAnimatingRight = true;
        }

        if (Input.GetKeyDown(KeyCode.RightArrow) && isAnimatingLeftRight)
        {
            animator.SetBool("isAnimatingLeftRight", false);
            isAnimatingLeftRight = false;
            animator.SetBool("isAnimatingRight", true);
            isAnimatingRight = true;
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow) && isAnimatingLeftRight)
        {
            animator.SetBool("isAnimatingLeftRight", false);
            isAnimatingLeftRight = false;
            animator.SetBool("isAnimatingLeft", true);
            isAnimatingLeft = true;
        }
    }
}

LeftRight Means From Left To Right, and RightLeft Means From Right To Left!

I’ve found the problem, for some reason the script is fricking up the left lane. If you start in the middle, then turn left, then turn right, the part of the script that allows you to turn right again makes it impossible to get out of the left lane in the first part.

Script part that f’s up the left lane:

if (Input.GetKeyDown(KeyCode.RightArrow) && isAnimatingLeftRight)
        {
            animator.SetBool("isAnimatingLeftRight", false);
            isAnimatingLeftRight = false;
            animator.SetBool("isAnimatingRight", true);
            isAnimatingRight = true;

        }

Instead of changing from isAnimatingLeft to isAnimatingLeftRight, It changes it from isAnimatingLeft to isAnimatingRight. ( While broken part of script is in use )