animindex

Non-platform specific questions.

animindex

Postby Behdadsoft » Fri Sep 20, 2013 9:48 pm

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.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animindex

Postby skydereign » Fri Sep 20, 2013 10:08 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: animindex

Postby Behdadsoft » Sat Sep 21, 2013 4:51 pm

Right, Thanks.

+1 :D
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron