Game Development Community

Random Idle Animation?

by Erick Tjoe · in Torque Game Builder · 06/27/2011 (12:50 am) · 2 replies

I'm stuck with this. Can someone please help me?

For example :
An object has two idle animation, idle01 and idle02. The idle01 will be default animation which play all the time, but idle02 will appear randomly for random seconds, then revert back to idle01.

How do I code that?

About the author

www.caelumstudio.com

Recent Threads

  • Help me decide

  • #1
    06/27/2011 (11:02 am)
    You can use the setAnimation(%animationName) command to change an animation on the fly. You can do something like:

    %hero.schedule(getRandom(100, 300), "setAnimation", "idle02");
    %hero.schedule(getRandom(400, 800), "setAnimation", "idle01");

    to change the animations randomly.
    #2
    06/27/2011 (5:34 pm)
    Thank you so much. I'll try that