Page 1 of 1

CHANGE ANIMATION RANDOMLY WHEN CLICKED?

PostPosted: Mon Jan 21, 2008 7:45 pm
by lordezak
can anyone tell me if i can (by the push of a button) make the animation change between 2 animations from the original. :D
if i need script then the two animations (preloaded to character) are 'yes' and 'no'
plz include them in the script (if script is needed) if not brill :D

Re: CHANGE ANIMATION RANDOMLY WHEN CLICKED?

PostPosted: Mon Jan 21, 2008 8:47 pm
by DarkParadox
is it toggle?
like if it's yes it turns to no?

if it's random:
Code: Select all
int var;
var = rand(2);
if(var == 1){animindex = 0;}
if(var == 2){animindex = 1;}


if it's toggle:
Code: Select all
animindex =! animindex;

if you want it to check the animation:
create a variable called yes and put this in the code:
Code: Select all
if(animindex== 0){yes = 1;}//the first frame
if(animindex == 1){yes = 0;}//the second frame

Re: CHANGE ANIMATION RANDOMLY WHEN CLICKED?

PostPosted: Tue Jan 22, 2008 8:19 pm
by DarkParadox
got your message, try these codes.

Code: Select all
int var;
var = rand(2);
if(var == 1){animpos = 0;}
if(var == 2){animpos = 1;}


if it's toggle:


Code: Select all
animpos =! animpos;

if you want it to check the animation:
create a variable called yes and put this in the code:


Code: Select all
if(animpos== 0){yes = 1;}//the first frame