Forum rules - please read before posting.

Best Approach | Shifting between 2 animated states in AC object in scene

Hello there, I wondered if somebody could offer some advice please.

The scenerio :
I have an object in a scene that when you interact with it, an animation plays, and that is it. I may add some dialogue saying "whoops".

To further help to visualise, on a shelf is a jug, when the player looks at it, or interacts with the jug it rocks and falls from the shelf and smashes on the floor. The animation and effects have already been created, important and turned into an animation inside Unity. On the top of the jug falling animation is a Hotspot.

The issue is, the animation automatically plays when the scene loads ( Not sure of the best approach to make it idle or stop in other words on start ) I'm wondering what the best, most simple and non-convoluted approach would be to achieve this?

One thought I had was to make an idle animation, and set it in the mechanim. Or to see if I could get it to work via a Global or scene level piece of script / logic.

I have also added a piece script already to the hotspot ( OBJECT ) saying to play the animation of the jug falling. But the jug animation plays anyway when the scene starts

Any thoughts, thanks,

J

Comments

  • Going with separate animation states is the approach to take.

    It doesn't need to be a separate animation - an empty state in your Animator, set to be the default, is often enough.

    To handle the transition to the falling animation, create a Trigger parameter and reference it in a Transition that goes from Empty -> Falling state. This isn't involving AC, but just Unity's regular Animator workflow.

    It's then just a case of invoking this Trigger parameter at the correct time, which you can do with the Object: Animate Action, setting the Animation engine to Mecanim, the Method to Change Parameter Value, and filling in the details of the Trigger parameter to affect.

  • Hello Chris, thank you for the advice. I followed with this and it worked a treat on a couple of 'objects' in the scene. Very pleased. :)

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.