Search Unity

Blend tree not applying animations

Discussion in 'Animation' started by ComboRoutine, Feb 19, 2014.

Thread Status:
Not open for further replies.
  1. ComboRoutine

    ComboRoutine

    Joined:
    Feb 3, 2014
    Posts:
    24
    I'm using a blend tree to control animations. When the speed is 0, play idle, 8 for walk and 12 for run. The problem is that no matter how big my speed is, all the character plays at all times is the idle animation, as seen in this picture:
    $BlendSpeed.JPG

    The blend tree clearly shows that the walk animation should be playing, and the preview for the animation works perfectly as well. I'm probably missing something really simple here, but I've already been at this for about an hour, and I'm starting to get pissed off, so... Any ideas?
     
  2. ComboRoutine

    ComboRoutine

    Joined:
    Feb 3, 2014
    Posts:
    24
    Well, after downloading Blender, learning to use the program and doing the whole goddamn rig all over again in hopes that it'd affect anything, I'm still stuck. Now it's playing the walk animation forever instead of the idle animation, though. So I don't even F***ing know. I'm, like, one step away from trashing the entire project file and starting all over again. This is my last cry for help. ANY ideas are welcome, just give me something to check for, maybe it'll snowball from there and I can figure this thing out.
     
  3. SeanHoward3D

    SeanHoward3D

    Joined:
    Dec 12, 2013
    Posts:
    20
    Hello, Just an idea but heres a checklist.
    - Is your speed parameter a public float?
    - Have you tried doing a debug log to check the current speed value?
    I need to see more though so feel free to contact me on skype so that I can investigate more. Best of luck otherwise.

    Skype - SeanHoward3D
     
    bowserscastle likes this.
  4. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    This is a long shot, but maybe you should check that your animations play properly on their own without the blend tree first.
     
  5. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
    I feel your pain. I followed through the one-hour and eighteen minute long 2D Animation tutorial and had the same problem. The character was there when play button was activated, the character would correctly face the direction I made him go, but animation state was locked to whatever happened to be set as the default animation (the default is the orange animation brick in your AnimaTOR screen). That default anim would play for me constantly, with no state change from the default. I realized that their scripting still seems to lack a lot of user friendliness, since an HOUR of programming by ME...who is NOT a programmer....had to be done in order to get the godforsaken simple state change (swap from Idle to Run) to actually work. (Really, Unity Guys?) So, I hope you didn't pull your hair out from sheer frustration with the lack of 'drag and drop' functionality, which is where this engine really needs to be by now for something so simple as standard game states.
     
  6. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    I don't think that is a good excuse. Unity is not Gamemaker, you need to know some programming to make your game. Don't worry you'll become better at it with time. Triggering a change of state is something very basic. If someone can't do this how are they going to do a complete game ?

    Also you can use spaces in your text and have different paragraphs as it makes it easier to read.
     
  7. Brinstar

    Brinstar

    Joined:
    Jul 28, 2017
    Posts:
    4
    I had the exact same problem. my character move from right to left, can jump, but doesn't show the right animation (still the default one, Idle). Is someone out there that knows how to get that fix? (I'm using unity 2108 1.6f1)
     
  8. gambitslacklines

    gambitslacklines

    Joined:
    Feb 23, 2015
    Posts:
    14
    have you set your animations to loop or made sure that they have a similar length.

    All clips only would play once in the standard setup, so as soon you enter the blendtree all animations are running once at the same time, when they reach the end-frame they just stay there as long you do not exit and reenter the blendtree(as example with Transition-to-self) or set the animations themself as loops.
     
  9. sadilfh_unity

    sadilfh_unity

    Joined:
    Oct 6, 2018
    Posts:
    1
    upload_2018-10-6_17-58-51.png
    make sure "Speed" is greater then 0
     
  10. Eriksberg_

    Eriksberg_

    Joined:
    Feb 3, 2019
    Posts:
    1
    I had the same problem but I solved it by changing the Update Mode to Animate Physics on the Animator. upload_2019-2-3_20-46-48.png
     
    aedie, tevekidis, sasserdos and 3 others like this.
  11. Drudail

    Drudail

    Joined:
    Jul 4, 2014
    Posts:
    1
    Odd as it might sound, I got it to work by exposing the Animator as a Public object and linking it through the workspace rather than using GetComponent in the script. I have no idea why it made a difference, but it did. I tested it initially by commenting out the GetComponent line, got it working, then tried doing it through code again. Whenever I used the code the sprite was locked in whatever animation it started in, but as soon as I used the inspector it would read the animation states correctly.
     
  12. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    This worked for me with same problem. Any clue why?

    My blend tree was working fine, then I swapped the mesh out. My first test was cool, but after closing unity and opening the following day I then had this issue. Very strange.
     
  13. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,023
    I found that if I duplicate the animation (not using the one that is a child of the FBX file in the Project tab) then it works. Unity seems to have a real problem with anything that is in the model file, greying stuff out all over the place and, it seems, not letting stuff work.
    EDIT nevermind, wrong animator controller o_O
     
    Last edited: Dec 12, 2019
  14. hariharan-vn

    hariharan-vn

    Joined:
    Mar 1, 2016
    Posts:
    2
    I have faced the same problem with blend tree after setting the animation graph and changing the blend value , I see no change in animation
    after serious hours of dealing with problem I have found a solution

    The animations that I'm using in the blend tree are not looped animation so I changed it from play once to loop
    by activating loop check box

    which worked for me

    problem with this
    - the animation will be playing continuously -> this can be solved by manually setting the animation speed in the blend tree

    Thats it , Thanks

    Happy if this works for you
     
  15. artirohernandezdiseno

    artirohernandezdiseno

    Joined:
    Sep 21, 2020
    Posts:
    1
    Hello, there, i had a similar problem for my 2D jump animation, it appeared that the blend tree was stuck with the first and last frame and not played the animation, problem was the threshold value was just from -1 to 1, so the animation was so fast that effectively appered like just 2 frames were rendered, so I just cranked up the threshold from -10 to 10, checked the Automate Threshold box so Unity calculated the appropiete values for the other frames and voila. Hope this helps someone.
     
  16. marspot

    marspot

    Joined:
    May 22, 2020
    Posts:
    7
    I know this is a necropost.. but someone might come across here with the same issue. I was making an electrical beam that I wanted to animate one of 3 random animations, so not all electric beams appeared the same to the player and there was a bit of randomness. To accomplish this, I created three animations of random frames from a sprite sheet, then put those into a blend tree with a float parameter to control the state of the animation. In the code for the beam, I used a random range generator to assign a random float value to the animator parameter i was using to control the animation.

    Problem: When I first made the controller, it defaulted to the first animation that was created for the beam and was only transitioning to it from start. No matter what I

    Solution: I had to go in and delete all of the animations except for the blend tree I made from the base layer of the animation controller. Once the controller was transitioning straight to the blend tree from start, the animations all displayed correctly as I intended. An obvious mistake, but it took me a minute to get it figured out.
     
  17. krishnanpc

    krishnanpc

    Joined:
    Oct 30, 2017
    Posts:
    19
    I had the same problem. Solved it by changing the blending mode to additive.
     
  18. Mantra-Games

    Mantra-Games

    Joined:
    Nov 27, 2012
    Posts:
    170
    I've copied over Opsive's third person controller and animations from a blank project into mine (Cause I didn't want to mess up the tags/layers/settings if I imported the package.

    Anyway I'm using Corgi Engine for my 2.5D game and the animator will move the character and play the idle but not any other animation. Anyone know a fix for this by any chance?
     
  19. beerdedbandit49

    beerdedbandit49

    Joined:
    Aug 3, 2020
    Posts:
    1
    Make sure you're entering all the right parameters in the inspector for your tree.
     
  20. Avisan

    Avisan

    Joined:
    Apr 4, 2021
    Posts:
    2
    Hey guys.

    Here because I had a similar problem but after a few days I found something!
    Make sure that in the inspector window for your character, you place your Animator component on the character mesh, not its overarching Player object.

    Perhaps you placed your idle animation on your character in the scene view and then made a blend tree in the animator immediately after. Be sure to take the additional step to see if the subsequent movement animations are targeted to the mesh. Otherwise, your character mesh will loop the animation you dropped on it, but the animator component will only be sending animation data to the empty object controlling your player.

    Hopefully this was clear and made sense, and I wish you luck moving forward!
     
    lextechex likes this.
  21. Snowman1260

    Snowman1260

    Joined:
    Jun 5, 2018
    Posts:
    1
    Hey guys, I had the same issue, it turns out that in the script, there was animations on true (idle), only desactivate the script to see if the blend tree works, good luck
     
Thread Status:
Not open for further replies.