Im using DOTween to animate some gameobjects. I have two animations on the same object. The first animation, it plays automatically when is activated. I want to play the second animation in a certain moment. How can I do that?
Here’s a screenshot of how I have the animations in the gameobject.
@DarkSlash : I think you can do that in two ways.
One I prefer would be to add a String ID to both DoTween Animation. Then in the script you can call the function when you click on button or in action,
//Make Sure to include
//using using DG.Tweening;
DOTween.Play ("YOUR_ID_HERE");
(Or you can have a DOTweenAnimation dotweenAnims; array to store the animations by GetComponents<>() and call the DoPlay() function of it)
Do you know the exact moment in time, or is this an unknown time, such as whenever a player jumps or attacks? If it’s exactly known, then try using the delay option on the second script. If the time is unknown, then try having it called at a certain time in a script. If you meant to have the second animation play x seconds after the first, I’d recommend calling both in script, such as:
DoAnimation ()
{
Animate1();
//Wait 2 seconds
Animate2();
}