Select Page
Search

Using Animation Trigger

In this Tutorial you will learn how to setup Animation Trigger that enables your model to play an animation you created in your 3D software. Note that at the moment only parametric animations are supported. You can change the position, rotation and scale of your model or parts of it.

Import Settings

Select your model located somewhere in your Assets folder and click on the “Rig” tab in the Inspector window. Set the Animation Type to “Legacy” and Generation should be set to “Store in Root (New)”. All the other model import settings can be made as usual and stated in other tutorials.

Scene Setup

First create a new Vuframe Scene, by creating an “Empty Game Object” and adding the Vuframe “Scene Component”. Or by navigating to the menu bar to “GameObject” and click on “Create Vuframe Scene”. Create a prefab out of that Vuframe-Scene object. Next, drag and drop the 3D model with your animation into the Unity scene and make it a child object of the Vuframe-Scene object. Apply your changes to the prefab. It should look like in this screenshot.

When selecting the object of your 3D scene, with the animation, you will recognize that it has “Animation” Component this will be important later in this tutorial. Now add another “Empty Game Object” and name it “animation-trigger”. The naming of this object not crucial but helps you keep track of the objects in your Vuframe scene and later in the CMS. Click to “Component”, in the menu and navigate to “Vuframe Cloud/Hotspots/Animation” the Animation Trigger also needs to be a child object auf your Vuframe-Scene object. Apply you changes to the prefab.

After adding the Component to your “animation-trigger” object you need to assign the object that carries the animation data. Select the “animation-trigger” and scroll down until you see a field “Target Animation”. (marked red in the screenshot below)

Drag and drop the object with the “Animation” component to this field. Apply your changes to the prefab, setup up your camera and scene as usual with lights and proper camera-settings and publish. Add the 3d scene to a SmartVu and test it on your device. A button, similar to an Ego POI or Event-Trigger is displayed. If you tap on the Trigger the animation is played first to last frame. If you tap on the Trigger a second time the animation is played from the last to the first frame. So for an example, if you want to create a open-close animation you only need to animate the object opening. The Animation will stay on the last frame until the trigger is activated a second time.

If you don’t want to us a screen button and want the user to tap on a certain object you can also add the “Animation Trigger” component to an object. Add Box Collider to the object and scale it to your needs, activate “Collider Responds to Clicks” and deactivate “Enable Screen Button”

You can also deactivate both option and trigger the animation with an action and a button in the sidebar. Use the “activate trigger” 3D command in the Actions tab and link it to a button in the sidebar.

Was this helpful for you?