Search code examples
animationunity-game-engineanimator

How do I play animation using <Animator> in unity 3D (2017.3.1f1)


I'm new to unity and wish to animate a prefab. Here's what I've been able to achieve so far: Fern sway I created an Animator for a prefab and created an animation sequence via the timeline editor. Though the animation plays in Unity 3D preview, but not the Game tab, I am unable to see the animation when I'm using it with Vuforia AR sdk.

I tried a similar approach with a 3D cube object I created in Unity and the animation works in Vuforia AR sdk. It even plays in preview and device.

Door close I've searched the Unity forums, added scripts, embedded the gameObject inside another, and so on... but haven't been successful.

I'm testing it on iPad 2 running iOS 9.3

How can I see the animation on a device? Any help would be appreciated.


Solution

  • The solution that worked for me is this:

    1. I created a new gameobject as one usually does in Unity.
    2. Applied the Mesh Filter , Mesh Renderer and Material of the prefab
    3. Added the Animator and created the animation sequence via the timeline editor

    Tested the code successfully in Unity preview as well as device. The Vuforia sdk too supports the animations.