> ## Documentation Index
> Fetch the complete documentation index at: https://docs.altoura.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Implementing Animations

> Overview Implementing Animations is a method for adding motion to your spaces, experiences, and objects on the Altoura platform. You can author animations in your favorite 3D software package be it 3dsMax, Maya, Blender, and more. Animations are a way to add compelling moments, contextual information, demonstrate processes, and bring life to your Altoura projects. You can also take advantage of Unity’s built in Timeline feature. It resembles a non-linear video-editing interface with a layered, multi-track, drag and drop editor for organizing your motion design. Import FBX files from your favorite 3D tool, or start keyframing directly in Unity. Either way, however you and your animation team are used to working, it will dovetail with Altoura.

**Here are elements of Altoura regarding Animation:**

* Experience Builder – a no-code, web-based node-editor that refreshes quickly for rapid iteration.
* Info Panels – can be placed in the 3D scene and edited quickly and easily in the Experience Builder.
* Target objects – can be specified and a digital lasso directs the user attention to the relevant 3D object.
* Step Animations – choose auto-generated interpolation, or custom animations from the Animation settings on the nodes in the Experience Builder.
* Instruct Animations - help visually show the user what to do in a step-by-step experience. These are especially useful for immersive experiences with Head Mounted Display devices like Hololens2. Instructions play during a step, most often in a loop. They are automatically de-activated when the user completes the step.
* Transition Animations – help visually show an important change in the 3D scene and ‘set the stage’ for the next step in your experience. Transitions play when the user completes the step. They are a great way to curate the supporting items in a 3D environment.
* Success Animations – help users get that feeling of virtual participation when using non-HMD devices like tablets and laptops.
* Manipulations – give users the sense of moving and inspecting objects in their hands.
* Collider regions – detect when the user has manipulated an object into an acceptable tolerance range to complete a manipulation.
* Snap positions – provide a satisfying completion to each step when users manipulate objects into a region correctly.
* Constraints – objects can be set to move, rotate, or scale along individual axes.
* Videos – can be added to hovering info panels.
* Networked motion – allows participants on tablets, laptops, and HMDs to see the same motion graphics as they play out because they are linked together in the cloud.

What Animations are fundamentally based on anim clips and are stored in a Unity asset bundle. Once the asset bundle is uploaded to the Altoura portal, the animations can be used in the Experience Builder. Simply pass the name of the appropriate Unity GameObject into a slot in the step-by-step node in the Altoura Experience Builder.

How During a step with an animation, Altoura’s code looks through the hierarchy of the specified GameObject for a Playable Director Component (Timeline). If it finds one, it will play it. This document will focus on Timelines.

If Altoura’s code finds a specific Animator component instead, it will play it. This can come in handy in certain situations but is recommended for experienced Unity users only. More info can be found here. Unity - Manual: Mecanim Animation System (unity3d.com)

Best tools for doing this? Modelling: 3dsMax, Maya, Blender, SketchUp. File Formats: Any tool that can export an FBX will work best. You can drag and drop FBX files into Unity.

Prerequisites Unity 2019.3.7f1 installed via Unity Hub. Drag the Altoura Toolkit and Altoura Sample Content unity packages into your Unity project. MRTK (optional but recommended)

Sample Unity Project ? Coming soon

Auto-Generated Motion Set a Training object and a Snap Object. The Altoura code will interpolate the object from the starting point to the Snap point. The starting point is derived from the position, rotation, and scale of the Training object. The Snap point is derived from the position, rotation, and scale of the SNAP object.

**Creating a SNAP Object** A snap object is just an empty game object with a transform component, nothing else.

**Custom Animations** It is possible to create custom animations using Unity’s Timeline editor.

**Timelines – Tutorial using sample content**

Instruct Animations – referring to the sample scene content you can see an example of an instruct animation that for inserting a key into a lock-safe. A semi-transparent hand grips a semi-transparent key and inserts it into the lock. To create this Instruct Animation in Unity: Create an Empty Game Object GameObject > Create Empty Rename the object. It is recommended to name it something easily recognizable such as InsertKey\_INSTRUCT. Create a Timeline If the Timeline tab is not visible go to Create Window > Sequencing > Timeline Select the object InsertKey\_INSTRUCT and tap the Create button in the Timeline tab.

<img src="https://mintcdn.com/altoura-785c3552/rSHiWKFaLfV4dcN7/images/docs/61cd31e-Picture1.jpg?fit=max&auto=format&n=rSHiWKFaLfV4dcN7&q=85&s=2745307594cf303fe896f0ac863b6157" alt="624" width="624" height="144" data-path="images/docs/61cd31e-Picture1.jpg" />

You will be prompted to save a .playable file in your Unity project. It is recommended to save it in the Assets/Animations folder. Create one if it does not exist already. The filename will be auto populate to be: InsertKey\_INSTUCTTimeline.playable Click SAVE

Your Inspector tab will look like this:

<img src="https://mintcdn.com/altoura-785c3552/z2_JFZPNE9ekTL9F/images/docs/a0f9247-Picture2.png?fit=max&auto=format&n=z2_JFZPNE9ekTL9F&q=85&s=6f899923bb358dd08e51587e31455b95" alt="396" width="396" height="428" data-path="images/docs/a0f9247-Picture2.png" />

In your Timeline tab, click the lock icon to keep this window focused.

<img src="https://mintcdn.com/altoura-785c3552/pvN_b_9fLlPnvtUQ/images/docs/1d8cfa3-Picture3.png?fit=max&auto=format&n=pvN_b_9fLlPnvtUQ&q=85&s=a5228c693b9a394503874d28b0611042" alt="624" width="624" height="136" data-path="images/docs/1d8cfa3-Picture3.png" />

<img src="https://mintcdn.com/altoura-785c3552/rSHiWKFaLfV4dcN7/images/docs/5abcae5-Picture1.png?fit=max&auto=format&n=rSHiWKFaLfV4dcN7&q=85&s=67dd80d31c7a5d19b22d26e6c6bf8c25" alt="624" width="624" height="136" data-path="images/docs/5abcae5-Picture1.png" />

In your scene hierarchy, drag the objects: HandRig\_R and Key\_looping into the timeline tracks area and ‘add animation track’ for each.

<img src="https://mintcdn.com/altoura-785c3552/z2_JFZPNE9ekTL9F/images/docs/ae9b2fa-Picture3.png?fit=max&auto=format&n=z2_JFZPNE9ekTL9F&q=85&s=f92ccd0424077c7eacf027d295f5ed39" alt="624" width="624" height="143" data-path="images/docs/ae9b2fa-Picture3.png" />

In your Unity project tab, navigate to the Animations folder and find the clip NearSelect\_R and drag it into the Timeline track for HandRig\_R.

<img src="https://mintcdn.com/altoura-785c3552/_Fb1P96m80-mEejg/images/docs/4fd3db7-Picture4.png?fit=max&auto=format&n=_Fb1P96m80-mEejg&q=85&s=4e6c5866bfd38aad95d8db7c601ef196" alt="122" width="122" height="121" data-path="images/docs/4fd3db7-Picture4.png" />

<img src="https://mintcdn.com/altoura-785c3552/FoIV9SzgFfYMUXXv/images/docs/33465b0-Picture5.png?fit=max&auto=format&n=FoIV9SzgFfYMUXXv&q=85&s=c9a2f607dc408f7fb6e28ef140b1afe1" alt="624" width="624" height="137" data-path="images/docs/33465b0-Picture5.png" />

Find the clip InsertKey and drag it into the Timeline track for Key\_looping.

<img src="https://mintcdn.com/altoura-785c3552/rSHiWKFaLfV4dcN7/images/docs/74b0c27-Picture6.png?fit=max&auto=format&n=rSHiWKFaLfV4dcN7&q=85&s=ef4d72bf18791289284b3f1ac1f1182a" alt="624" width="624" height="137" data-path="images/docs/74b0c27-Picture6.png" />

In the Inspector tab, in the Playable Director section, the box is checked by default for Play On Awake.

<img src="https://mintcdn.com/altoura-785c3552/z2_JFZPNE9ekTL9F/images/docs/ab8645c-Picture7.png?fit=max&auto=format&n=z2_JFZPNE9ekTL9F&q=85&s=31a63e6bdc14d58ad24cb3537b3fc8c7" alt="381" width="381" height="412" data-path="images/docs/ab8645c-Picture7.png" />

If you want an animation to just play in your scene by default, leave this checked. This is a good way to create some motion in your scene with no extra functionality.

If you want to trigger this animation on a step in the Experience Builder, uncheck Play On Awake. For Instruct Animations it is recommended changing the setting Wrap Mode to Loop. This will cause the animation to repeat over and over until the user completes the step.

In Unity, in the Inspector tab, select and copy (ctrl+C) the name of the Game Object InsertKey\_INSTUCT

In the Altoura Experience Builder, on your step by step node, find the field for Instruction Animation Object

<img src="https://mintcdn.com/altoura-785c3552/z2_JFZPNE9ekTL9F/images/docs/aaecff1-Picture8.png?fit=max&auto=format&n=z2_JFZPNE9ekTL9F&q=85&s=ede5df4873fd04bc015d410124f9b3e0" alt="624" width="624" height="385" data-path="images/docs/aaecff1-Picture8.png" />

Check the box for Custom then place your cursor in the field and paste (ctrl+V).

<img src="https://mintcdn.com/altoura-785c3552/FoIV9SzgFfYMUXXv/images/docs/25b20c7-Picture9.png?fit=max&auto=format&n=FoIV9SzgFfYMUXXv&q=85&s=7d04d224b07b844ff70261d50c841359" alt="624" width="624" height="360" data-path="images/docs/25b20c7-Picture9.png" />

***

Transition Animations - referring to the sample scene content you can see an example of a transition animation that shows the lock-safe door swinging open.
