Call Animation within Timeline
Hi all! I see a lot of people asking similar/same question but no concrete answers.. I want to add a second animation inside the timeline, in this case, a "swoosh-animation". I was hoping I could just create an Animation and drag it into the timeline... But no... I guess I have to create an empty object, attach the animation to it, and a script and then call the script from this timeline... But how?
Thanks in advance!
Edit. I kind of solved it.
[CODE]
public class RunSwosh : $$anonymous$$onoBehaviour
{ public Animator anim; //public ParticleAnimator
public void DoSomething()
{
Debug.Log("Do Something");
anim.Play("RunSwosh");
}
}
[/CODE]
I put the "Showh"-smoke (gameobject) as a child to the player and added "add event" to the animation timeline, and I clicked on "Do Something"... So now its calling the smoke effect every time the timline hits that little "white event flag"... :) Its not perfect.. I wish I knew I how to write a script so it only played once. Now I made a transaction inside the animator. like.. [Swosh]---->[New Entry] so at this point it stops over at [New Entry] and next time I press punch button it goes back to [Swosh]-.--- Hope it helps and ask me anything if you need help. not sure if I managed to explain well
Answer by RuneShiStorm · Sep 26, 2017 at 10:05 AM
I managed to fix it and I'm linking my "guide" in case anyone else need this as well :)