animated a model with a button in Unity with vuforia

I am working with unity and vuforia and what i am wanting to do is have the image target render my 3d model and a visual button. the model will be animated. I need the button to start a new animation for the 3d model when pressed but as soon as the animation finishes it needs to go back to the original animation. Please help me find the correct way to do this.

1 Answer

1

For full answer, goto forum HERE.

[OLD]
Using the animation component, you can have the button event call animation.Play(“animation name”);.

When the animation is over, animation.isPlaying = false;.

void Update()
{
  if(!animation.isPlaying)
  {
    animation.Play("default animation");
  }
}

so at the end it will go back to original animation? and i want a different obj to control the animated model's animations

so you took all the hard work out of this for me? thanks

I am getting this error The type or namespace name `String' could not be found. Are you missing a using directive or an assembly reference? for 3 locations

Make it lowercase: "string".

then i get a lot of errors like Type string' does not contain a definition for wrapMode' and no extension method wrapMode' of type string' could be found (are you missing a using directive or an assembly reference?)