Forum rules - please read before posting.

How to animate an object only once, using an action list in Adventure Creator?

I've tried watching Unity animation tutorials, I've tried reading the documentation and I just don't understand how to animate an object on command. Is it possible to write the steps how to accomplish this please?

If I drop my frames into the scene tab, an animation prompt comes up. This works and I can make a simple looping animation of my frames. Great, but the animation just loops forever.

But how do I make an animation of frames that only plays when a player clicks on a hotspot, then only plays once? Say like a door opening when you click on it?
The hotspot and action list are built. The animation is built. Just not clear what to do with the "Object:animate" tab in the action list.


Comments

  • Whether a clip loops or not is set within the clip asset's Inspector: select the KitchenDoor_Open asset file, and uncheck Loop Time at the top.

    To play it at the correct time, you'll actually need two animation states in your Animator component - the other being an empty animation that plays by default, to prevent the Open animation playing when the scene begins.

    Your Animator Controller asset file, Kitchendoor_open_4, is where the animation states available to play are kept. Double-click this asset to bring up the Animator window, right-click in some empty space and choose Create state -> Empty. Then select the new state that appears, right-click and this time choose Set As Layer Default State. This will turn it yellow to indicate that it's now the default.

    Having the KitchenDoor_Open asset file play at the intended time is now a case of running the Object: Animate Action. Because you're using an Animator component, the Animation engine needs to be set to Mecanim, not Legacy. The reasons for this are historical and are to do with Unity's naming convention of the Animator system back when it was marketed as the new animation workflow. Admittedly it can be a little confusing at first, but outside of character animation, generally "Mecanim" is the option to choose here.

    You now need to tell the Action which animation to play. You can either do this with Transitions, or by referencing the animation by name. For the latter, set the Method to Play Custom, Animator to Kitchendoor_open_4, and Clip name to the name of the animation state (looks to be Kitchendoor_open_4 here as well).

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.