Ok what i understood is that animindex = 0 refers to the
current animation that is running on your Actor.
Let's say your actor hase two animations Walk and Stand. If, in Actor Control, you've selected Walk, then Walk is when animindex = 0. And if, in other way, you've selected Stand (even if Stand has been loaded After Walk animation) Stand
IS then animindex = 0. So it depends on what animation is loaded on Runtime ! i think
So i think you should do this to test first :
Create 2 actors (Actor1 and TestActor)
on Actor1, put two different animations. TestActor is to test animindex.
on Actor1 > play animation Walk.
Add Event CreateActor
Add Action Script and write :
- Code: Select all
animindex=0; //animindex count always starts from 0.
Add Event KeyDown [w]
Add Action Script and write :
- Code: Select all
animindex=1;
Add Event Mouse Button Down [LEFT]
Add Action Script and write :
- Code: Select all
switch(animindex)
{
case 0:
ChangeTransparency of TestActor.
break;
case 1:
Change VisibilityState of TestActor ie make TestActor invisible.
break;
}
What will happen is that when you'll have animation Walk (animindex=0), on Mouse click, TestActor will be lightly Transparent . Press "w" to Change animindex.Now animindex=1. On Mouse click, TestActor will dissapear.
If you want to test animindex on TWO Actors, repeat this on the Second and just play with the code!
Maybe there is a much more Logic code, but i have exams soon and maybe i'll see you with something better after.
Cheers