Playing animation

When the idle animation plays in my game after a certain amount of time without touching anything i want the second
idle animation to play once and then go back to the original idle animation which carrys on looping for a certain amount
of time and then plays the second idle animation so on, How can this be achieved??

Using javascript.

thanks. :hushed:

Try creating a variable that adds every time a cicle of the first Idle is completed, set a max amount then when that value is reached switch to the second Idle and reset the value, repeat and rinse from this