Page 1 of 1

animindex

PostPosted: Fri Sep 20, 2013 9:48 pm
by Behdadsoft
Hi.

My actor have 2 animation:
open = animindex 0
close = animindex 1

now I want when bullet collide with my actor, check it if animindex == 1 destroy it. i used this code:
bullet -> collision (Any side of my actor) -> Script Editor
Code: Select all
switch (animindex)
{
   case 1:
   DestroyActor("Oghab_Wall1");
   DestroyActor("White_Bullet");
}

but when my animindex is 0 or 1, destroy my actor.

Please Guide Me.

Re: animindex

PostPosted: Fri Sep 20, 2013 10:08 pm
by skydereign
Behdadsoft wrote:now I want when bullet collide with my actor

Notice the event actor is the bullet, and the collide actor is your actor. Because the bullet is the event actor, animindex refers to the bullet's animindex. If you want the colliding actor's, you need to use collide.animindex.

Re: animindex

PostPosted: Sat Sep 21, 2013 4:51 pm
by Behdadsoft
Right, Thanks.

+1 :D