Page 1 of 1

Pick a animation frame?

PostPosted: Sat Dec 02, 2006 5:49 am
by HillBilly
Is there any way I can pick a specific frame in a animation?

What I would like is to have a spinning object, but I want to have a random number pick 1 frame of the animation, like animation frame #12 and that would be that object.

PostPosted: Sat Dec 02, 2006 7:25 am
by Joshua Worth
frameindex is the variable name

PostPosted: Sat Dec 02, 2006 1:24 pm
by Novice
Joshua Worth wrote:frameindex is the variable name


I think you meant "animpos".

PostPosted: Sat Dec 02, 2006 2:49 pm
by HillBilly
OK, can I talk you into some kind of example. The online manual does not say much about this command. :?

PostPosted: Sat Dec 02, 2006 3:49 pm
by Novice
On create actor or any other event use this code
Code: Select all
animpos=round(rand(nframes));

before that you have to change animation direction to stopped to avoid flickering.
You can replace nframes with any number you wish, this way it takes the number of frames your animation has. So if your animation has 10 frames you will get a random frame from 0 to 9 (the first frame counts as 0).

PostPosted: Sat Dec 02, 2006 10:31 pm
by Joshua Worth
Novice wrote:
Joshua Worth wrote:frameindex is the variable name


I think you meant "animpos".
sorry, i forgot

PostPosted: Sun Dec 03, 2006 1:05 am
by Novice
No problem :wink:

PostPosted: Sun Dec 03, 2006 3:13 am
by HillBilly
That works great. THANKS for the help.