Kooldudese wrote:This sounds like a nooby question but what does the animation index refer to?
if (animindex!=1) //if not equal to the required animation - index '1' (in this case - 1)
//or 2 or 3 or whatever the correct index number is
{
ChangeAnimation("Event Actor", [i]'animationname"[/i], FORWARD); //then change to required animation -
//and now that the correct one is now loaded
//it won't get loaded again
}
ChangeAnimation("Event Actor", "animationname", FORWARD);
debug.textNumber=animindex;
int whatanim;
whatanim=enemy.animindex;
if (whatanim==1) //animindex of the animation of the enemy with shield up..
{
//then enemy has shield -
//code here
}
else
{
canshoot=1;
}
animindex: Use animindex(count from 0) to find the actual animation of your actor. Each animation that an actor has has a unique index assigned to it. ( This way you can tell which animation is currently running. )
If your actor has 3 animations, then:
The first animation has animindex = 0
The second animation has animindex = 1
The third animation has animindex = 2
This variable is read only.
x-=3;
if(anim==0)
{
ChangeAnimation("Event Actor","WalkLeft",FORWARD);
anim=1;
}
x+=3;
if(anim==0)
{
ChangeAnimation("Event Actor","WalkRight",FORWARD);
anim=1;
}
anim=0;
Users browsing this forum: No registered users and 1 guest