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
1For 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
– tredproso you took all the hard work out of this for me? thanks
– tredproI 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
– tredproMake it lowercase: "string".
– Spinnernicholasthen i get a lot of errors like Type
– tredprostring' does not contain a definition forwrapMode' and no extension methodwrapMode' of typestring' could be found (are you missing a using directive or an assembly reference?)