Forum rules - please read before posting.

Animate with keyframes created in Unity animation editor

edited July 2023 in Technical Q&A

Hello there,
I ran an animation from action script, and I added a scale keyframe for the animation inside the animation editor, in order to scale-flip it (to avoid having to use double the amount of sprites with mirrored sprites).

Originally I wanted to use the "Add directional suffix" option with it.

Even though in the animator the animation plays correctly, inside the game it ignores the scale keyframe entirely.
Is there a way to play the animation as it is played inside the animation editor?

This is the animation playing inside the editor (it is flipped correctly):

But inside the game it does not scale and flip it anymore, and the chicken faces to the left instead:

I run the simple ChickenLayEgg_R animation:

And have setup the animation normally for the player's animation controller:

I get no messages in the Console.

Comments

  • If you have "Frame-flipping" enabled in your character's Inspector, then AC will control the X-value of the sprite child's scale automatically based on the direction they are facing.

    If your original chicken sprite faces left, animate and name the sequence based on that (i.e. ChickenLayEgg_L). Then, in your Character: Animate Action, remove the "_R" from the Clip name, and check Add directional suffix?. AC will add "_L"/"_R" automatically based on the direction they are facing.

    If you have frame-flipping set to Right Mirrors Left, separate _R / _L animations are not necessary - having the _L variant in your Animator will be enough.

  • Thank you very much, I got it to work now!

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.