Forum rules - please read before posting.

Best practice for playing one-off animations in Sprites Unity Complex

I'm employing the Character Animate: Play Custom action in various places throughout my game in order to have characters play one-off animations (waving goodbye, taking an item from the player, picking up objects and so on), and finding that I'm having somewhat unpredictable results. The game uses Sprites Unity Complex.

In some cases, using Character Animate: Play Custom to trigger an animation that has one transition in the animator back to the idle state works like a charm. On other occasions, the custom animation simply doesn't play - watching the animator, it's as if the action list doesn't actually trigger the custom animation, and hence it never transitions back to idle.

I've had some success with using Expressions to trigger these animations, but I find here that the Expression Int doesn't reset to zero (even if the option to reset is selected in settings), resulting in the animation triggering over and over again.

Are other users forgoing play custom entirely, in favour of, for example, a parameter change, engine wait for the duration of the animation, and then a change back? It seems rather inaccurate to me, perhaps there are other ways of playing a single animation just once from an action list that I'm overlooking?

(also appreciate that this goes a little into Unity animator territory, but I've seen quite a few threads where users are having trouble in this area, so I thought I'd see what the consensus is)

Cheers,

Martyn

Comments

  • edited September 2020

    Do your Actions set a "Transition time" value? There is a known issue related to this whereby animations sometimes do not play correctly - this will be addressed in the next update.

    The best practice for custom animations, though, is to rely on the Unity best practice - i.e. to trigger animations indirectly through parameters, rather than directly by name.

    For example, you can create a "Wave" Trigger parameter that, when invoked, causes a transition from Idle -> Wave animation. To have the character reset to idle afterwards, you'd then add another transition from Wave -> Idle, setting Has Exit Time? to allow it to first complete the Wave animation.

    I find here that the Expression Int doesn't reset to zero (even if the option to reset is selected in settings)

    Can you elaborate on this with screenshots, as well as your AC version? It may be a bug.

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.