I’m new to unity and i tried making a jump, run, and idle “game” by changing parameters. I used this code but the problem is the running animation doesn’t work while the jumping code is in there (walking is on the 22nd line and jumping is on the 24th line). is there something wrong with my code or could it be something else?
i think the problem is not here. the problem is in the animator itself. can you post the tree and all its details along with the transitions?
Please, on next questions, share the code on text, to we can copy and edit on our editors, is difficult find errors on code that cant edit.
Im not sure, but inside your update function, the open { on IF ( line 23) have the else statment?
In that case
You are making on each frame , if space is not pressed AnimPar = 0, that means, AnimPar ever will be 0.
Maybe do you need check if up and space are not pressed AnimPar = 0?
In that case, remove the else and add one more IF statement:
if(!Input.GetKey("up") && !Input.GetKey("space"))
{
anim.SetInteger("AnimPar", 0);
}