title: Unity AR Vuforia - Start animation if triggerd
body: <p>Hiho Community,</p>
  
  <p>I use Vuforia for my AR-Android-App and I have a object with an animation and I try that it only plays the animation if the object is triggered. No errors but it doesn´t work. Here my code:</p>
  
  <pre><code>using UnityEngine;
  using Vuforia;
  
      public class start_animation_if_trigger : MonoBehaviour, ITrackableEventHandler
      {
              private TrackableBehaviour mTrackableBehaviour;
  
          Animator m_Animator;
  
          void Start()
              {
              m_Animator = GetComponent&lt;Animator&gt;();
              mTrackableBehaviour = GetComponent&lt;TrackableBehaviour&gt;();
                  if (mTrackableBehaviour)
                  {
                      mTrackableBehaviour.RegisterTrackableEventHandler(this);
                  }
              }
  
              public void OnTrackableStateChanged(
                                              TrackableBehaviour.Status previousStatus,
                                              TrackableBehaviour.Status newStatus)
              {
                  if (newStatus == TrackableBehaviour.Status.DETECTED ||
                      newStatus == TrackableBehaviour.Status.TRACKED ||
                      newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
                  {
                  // Play audio when target is found
                  m_Animator.Play("C4D Animation Take");
                  }
                  else
                  {
                  // Stop audio when target is lost
                  m_Animator.Play("none");
                  }
              }
      }
  </code></pre>
  
  <p>and some project screenshots: </p>
  
  <p><a href="https://i.stack.imgur.com/1er09.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1er09.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/aoIbH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aoIbH.png" alt="enter image description here"></a></p>