Parameter Integer Not Changing for Animator Transitions (C#)

Hello there, Unity community, I am Sparx. I am having some troubles with coding- our teacher is not all that… good, at teaching, but we have to complete a project. I am very new to this, and if you could explain why your answer works, or what I did wrong in addition to answering my question so that I can learn from this, I would greatly appreciate it. But if you can just answer it, I’ll be really grateful anyway. I’m very new to this, but I’ll attempt to give as much information as I can.

I am using C# script, and have been following a video tutorial (5. Making a 2D Platformer in Unity (C#) - Simple Player Animations - YouTube this is the part I am on, you can watch the previous ones if you want, but skip the spikes one, I didn’t use that) almost to the letter, with a bit of editing to fit the newer system as needed by the program. I am trying to make a platformer (more or less, in functionality), and my sprite character already walks and jumps just fine. My problem is that I have an idle animation, and a walking animation, and I need it to transition between them if the sprite is moving or not. To do this, I put both animations in the Animator, and added an integer parameter (named AnimationState). I then made transitions between the Idle animation and the Walking animation, so that if the parameter integer equals 0, the idle animation runs, and when it equals 1, the walking animation triggers. It works the way Wabble did it in the video, but I think I’ve encountered some kind of problem- even though I watch the window as I run the game, the integer does not change as I press A or D, and therefore (likely due to the Entry block, as I’ve inferred that’s what it does?) the idle animation plays continuously. I’d like help in figuring out how to fix this, or what went wrong? First, here’s my code (it’s the playercontroller script, attached to the dragon sprite and it works just fine doing every other job assigned to it in said script):

using UnityEngine;
using System.Collections;

public class PLAYERCONTROLLERYEAH : MonoBehaviour {
//Movement Variables
public float speedForce;
public Vector2 jumpVector;
public bool isGrounded;

public Transform grounder;
public float radiuss;
public LayerMask ground;

Animator anim;

Rigidbody2D rb;

void Start ()
{
rb = GetComponent();
anim = GetComponent();
}

void Update ()
{
//Moving Left/Right
if (Input.GetKey(KeyCode.D))
{
rb.velocity = new Vector2(speedForce, rb.velocity.y);
transform.localScale = new Vector3(1, 1, 1);
//Why does this not work? The parameter integer doesn’t change, but it should.
anim.SetInteger(“AnimationState”, 1);
}
else if (Input.GetKey(KeyCode.A))
{
rb.velocity = new Vector2(-speedForce, rb.velocity.y);
transform.localScale = new Vector3(-1, 1, 1);
anim.SetInteger(“AnimationState”, 1);
}
else

        rb.velocity = new Vector2(0, rb.velocity.y);
anim.SetInteger("AnimationState", 0);
		
	isGrounded = Physics2D.OverlapCircle (grounder.transform.position,radiuss,ground);
		
	if(Input.GetKey(KeyCode.W) && isGrounded==true)
		rb.AddForce( jumpVector, ForceMode2D.Force);
}

void OnDrawGizmos()
{
	Gizmos.color = Color.white;
	Gizmos.DrawWireSphere (grounder.transform.position, radiuss);
}

}

(Um, I’m not sure why it’s so weird… I’m sorry, I’m really new to this site.)

And here’s some hopefully helpful screenshots.

The top half of the code that got messed up in this question, and a screenshot of the animator and other windows.

If you could help me out, or at least help me figure out what’s going on, I would be extremely grateful!

Edit- The real answer was hidden in the brackets. I had to add brackets around the else if (isGrounded) command (the lines under it, that is) and the W key commands, to match those above it.