Page 1 of 1

A.I animations

PostPosted: Sun Mar 04, 2012 3:26 pm
by LowDefFTW
Im making a fighter type game but I cant figure out how to change the animation when the enemy is moving, I tried using this code

if (xprevious<x)ChangeAnimation("Event Actor", "right", FORWARD);
if (xprevious>x)ChangeAnimation("Event Actor", "left", FORWARD);

But the animation started again before finishing, I also would like to know if theres any way to use "and","or" operators.

Re: A.I animations

PostPosted: Sun Mar 04, 2012 3:50 pm
by jimmynewguy
For and use && and for or use ||
Code: Select all
if(var1 == 2 && var2 == 1)
{
// code
}
if(var 1 == 2 || var2 == 1)
{
// code
}

And for the animation, change "FORWARD" to "NO_CHANGE" so the animation will keep going instead of starting again.

Re: A.I animations

PostPosted: Sun Mar 04, 2012 4:08 pm
by LowDefFTW
thanks a lot!! :D