So I have a problem with a possible Unity animation problem. I made an (int) in the animator parameter. In the code, I assigned the int values as idle=0, walking=1, jumping=2.
However, everytime I load the game, it starts fine, with the state (int) value being 0 (which means it’s idle). However once I started moving left or right, the int value immediately switches to 2, but the character should be walking, not jumping. I don’t think it’s the transition problems in the animator, since they should be set correctly (I double checked). It probably is something to do with the code.
This is the whole code, which programs the character’s movements.
I followed this tutorial: Multiple Animations | Build a 2D Platformer Game in Unity #5 - YouTube
I am just a beginner, so help is really appreciated

