Animation problem - simple fix

ReviveEarly

New member
Joined
Apr 28, 2021
Messages
1
Programming Experience
1-3
Hello forum, hope you are all well. I have a little problem with my animation, which i'm certain is a simple fix.

Here is my code in the update function

C#:
if ((Input.GetKeyDown(KeyCode.Q)))
            {
                bool fire = Input.GetButtonDown("Q");
                animator.SetTrigger("walking");
                animator.SetFloat("walk", 5);
            }

animator is set in Start function, as well as float walk which also exists as an animation parameter.

My animator has 3 transitions, idle, walk and jump. Idle has two transitions to walk based on a float called walk that when greater than 0 the animation should run, and when less than the animation stops. I then have a transition from walk to jump that goes by whether the player is grounded or not, a boolean. Then two from jump back to idle based on ground being false.

Upon running the game, the walk animation runs without prompt and then shortly after goes straight to jump with no idle.

I have no idea how to solve this issue as I am a beginner and watching tutorials online. Please help!

Kind regards.
 
Is this Unity code? If so, someone should move this out of VS.NET general discussion.
 
Hello i have problem in my project ,
when i running the game the animation is working inside the animator , but the character of the player dos"t take the animation
 
@assd : Please start a new thread since your problem is different from the original post on this thread. Also take time to show us your code. Post the code as text in code the. Take time to explain what exact problem you are encountering, what your expected behavior is, and what you have done to try to fix the problem.
 

Latest posts

Back
Top Bottom