Forum rules - please read before posting.

Animation looping between states on its own

Hello,

I am experiencing a rather weird issue with the animations of my character. I followed the adventure creator manual and the youtube tutorial for animations. All is set and the animation clips work fine with the sprite. Except for one issue.

Once I dropped all the animation clips in the animation controller, it automatically created a link between any state and the Idle_R animation (as seen in the screenshot). No other transitions were created. In the video tutorial it saod that adventure creator handles those on its own. Now when I try to run the game, only the Idle_R animation is looping over and over, but none of the walking animations trigger. Ok, I decided to add transitions between the naimations. Once those were created, on game run the character loops through all the animations non-stop. Removed most of the transitions and am left with only what you see in the screenshot. As expected on game run, now the character loops only between Idle_R and Wak_R non-stop. Overall it seems all animations are being played one after the other (where linked with transitions) and not only the relevant one based on direction and idle/walk status.

The question is: How can I assign, which animation is played when?

image


Comments

  • If you've set your character's Animation engine to Sprites Unity, then you don't have to create any transitions - AC will play the correct animation by searching for it by name, which is why you have to enter the names of your idle / walk etc animations in the character's Inspector.

    If you prefer, you can rely on transitions and Mecanim parameters to control yor 2D character - for this, just set your characer's Animation engine to Sprites Unity Complex.  However, it's not possible to give more detailed advice without seeing your character's Inspector.  Please post it if you have more trouble.
  • Here is a screenshot of the character inspector:image

    I have entered the file names in the inspector as per the video tutorial and the manual.

    What happens namely is that, if I don't make any transitions, then when the game is run, it goes into the default animation and stays there. If I add transitions it starts looping between them.

    In any case, the moment I drop the animations in the animator an automatic stransition is made from entry to some of the animations, which becomes default (Unity 5.0.1f1).

    I am not sure, if there needs to be any other kind of other setup made in order for AC to recognize the animations correctly.

  • If I add a integer parameter Direction in the animator and set all the respective values in the transitions, then select Sprites Unity Complex, the game transitions ok between the animations based on direction, but keeps looping the last played animation until the character moves in another direction (as in does not transition back to the Idle animations in the animator, which also have their separate value as a parameter).
  • I don't know what transition you've set up that goes back to your idle - I'd need to see it before I could be of much help.  With Sprites Unity Complex, AC won't force the playback of specific animations - it will simply amend the parameters you give it.  What loops, transitions etc you assign are your choice.

    Going back to Sprites Unity, again: the animations should play themselves automatically, regardless of what's set as the default state.  There should be no transitions in your FSM between the standard animations.  The 2D Demo player's animator controller, Brain2D, demonstrates how a typical FSM can be set up for Sprites Unity.  If you've done this correctly and it's still not working, I will do my best to fix it for you - but I don't know which animation engine you're now using.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.