Forum rules - please read before posting.

Point and Click animation not playing

Hopefully the attached images will illustrate my issue and set up.
I've gone through the 2d game tutorial and everything works fine. When I click the tutorial character, everything works as expected.

**When I attempt the same set up, there's movement when I click but no animation.
**
It's like it's not even seeing the Standard 2D Animations

The following images show my setup as followed in the 2d Game tutorial. As far as I can tell, the settings are the same.

The game is a sidescroller with movement restricted to X axis, left and right.

Prefab character created through the AC-Editor-Character Wizard

Movement wise, I only have an Idle and Run




Experimenting with naming the nodes the same as the animation.  I didn't matter.



Comments

  • Welcome to the community, @matttardiff.

    There's a few things I'm seeing:

    1. Your Animator component on the sprite child is disabled
    2. The Run animation won't play unless you specify him to run, and since he has no Walk animation he'll only play his idle animation when walking. You can force running at all times via the Player: Constrain Action, but you might want to enter "Lulu Run" into his walk animation field anyway.
    3. If you enable directions as you have done, you will need to have directional suffixes on the animation names (e.g. "_R"). In the Player's Inspector, expanding the "List expected animations" panel will list all the animations that should be listed, based on your chosen options.

    A couple more things of note:

    1. If the character is attempting to play an animation that cannot be found, it'll be reported in the Console. You can also keep the Animator open at runtime to see exactly what animation is being played.
    2. Your sprite appears to be raised above the NavMesh. Make sure that the sprite's pivot point is in between his feet - see the 2D Demo's "Brain" sprites for an example. The pivot point can be set via Unity's Sprite Editor when a sprite is selected in its Inspector.
    3. The upcoming v1.67.0 update will respect the "Freeze Position" options chosen on the Rigidbody2D component, making axis-locking easier to handle.
  • Thanks for the quick response. I’ll check it out
  • edited March 2019

    The correct nodes are hooked up in the Animator and pointing at the animations with the right name Idle Run_R . Basically I tack on _R or _L, whichever it asks for.

    I haven't tried the Player: Constrain Action yet. I'll have to go back through the tutorial to learn how to set up an Action.

    I also enter the Lulu Run in the both walk and run field.

  • And, when I put the Lulu Run in all three fields, it'll still play the Idle animation coming straight from the Animator. As if this isn't firing at all. But when I change the value Walk Speed Scale, the character refuses to move on click.

  • Solved I think
    I had to recreate the Idle and Run animation nodes. Renaming them wasn't good enough. I made the animations out of the sprites and now I've got something working.

  • Well the animation won't stop. It keeps running when the character comes to a stop. I'll dive into the docs to see if I can figure it out.

  • I see you also have your "Walk speed scale" set to zero.

    Try setting that to match the run speed. If you don't ever want him to appear walking, then assigning your run values when he's technically walking shouldn't be a problem.

  • edited March 2019

    Thanks for the help so far.
    As far as the animation not stopping.
    When I switch the movement to Drag or DIrect, the animation starts and stops as expected. When the player reaches the point where I release, it goes from run to idle.
    But, when I use Point and Click or Straight to Cursor, which is what I want to use, the animation never goes from run back to idle.

    With Direct/Drag

    With Point and Click/Straight to Cursor

    I notice that you have two Brain controllers. Brain2D and Brain2D SpritesUnityComplex.

    The Brain2D SpritesUnityComplex nodes look closer to mine but I'm using Sprites Unity instead of Sprites Unity Complex. And looking at the nodes in the later, I see a transition from Idle to Walk and back to Idle.
    The transitions are based on the Float condition created in the Animator parameter.
    When applied to the transition it's using a greater/less than .1

    But, when I try to copy the transitions, my character freaks out.

  • edited March 2019

    I tried the possible solution of setting the facing directions to four and duplicating the 2 animations, Lulu Idle_R and Lulu Run_R . No good though, the animation still continues

  • edited March 2019

    Ok, so here is what works so far.
    Straight to Cursor

    • Walk Zero
    • Run 30
    • Make sure Single Clicking also moves player is off.

    Point and Click

    • Destination accuracy Zero
  • But, when I try to copy the transitions, my character freaks out.

    If you want to make use of parameters and transitions for animation playback, you'll need to switch to "Sprites Unity Complex" mode. "Sprites Unity" will conflict with transitions if they exist, because it works by playing animations directly by name.

    Using parameters and transitions to play animations is actually Unity better-practice. You haven't said if you followed my suggestion re: assigning the run animation name in your walk field / non-zero walk value, but switching to Sprites Unity Complex may be the better choice anyway.

    See the Manual's "Character animation (Sprites Unity Complex)" chapter for more on this, but if you're really stuck you may also PM me a .unitypackage for me to look at. This will need to include your Managers, the Player prefab, and all associated Player assets (sprites, animations, animator controller).

  • Thanks. I forgot to mention that putting the run in the walk field was a good idea.
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.