Animation plays on one script but not another

I’ve been trying to set up some basic 2d top-down controls, and I have a mostly-functioning script for animations. Thing is, it’s very messy, so I’ve been trying to transfer the information into a new script, but the “up” run animation will play for one script but not the other.

This is the old script that works:

// W is pressed, D is not
		else if (Input.GetKey(KeyCode.W) && !Input.GetKey(KeyCode.D))
		{		
			//Move at a 90 degree angle
			anim.SetInteger ("RunState", 9);
			sprite.flipX = false;
		}

and here’s the new script, which for the most part is exactly the same but fails to function:

//Up
		if (Input.GetKey (KeyCode.W))
		{
			anim.SetInteger ("Runstate", 9);
			sprite.flipX = false;
		}

The idle animation works for both scripts when I check either of them in the player component; does anybody know how to solve this?

(P.S I’d eventually like to add to the script that “if W or UpArrow is pressed,” etc. But I forgot what the or operator is in Unity. The information would be very helpful; thanks!)

Off the cuff, I would suggest the fact that your case is different. In the one that doesn’t work you use the key “Runstate” instead of “RunState”. I can’t quickly find a solid ruling on whether that key is case sensitive but there’s not a good reason for it to be case insensitive and I can see it being confusing to add case insensitivity. Some poor, misguided soul might also claim that it’s faster (in a meaningful way) for it to test for exact matches.

The second version has Run s tate instead of Run S tate. Mechanim parameters are case sensitive.