Page 1 of 1

destroy actor on collision -help-

PostPosted: Thu Jul 26, 2007 2:54 pm
by pixelpoop
Does anybody know what is wrong with my code?

I am trying to make it so when an actor is created it checks to see if it is on top of my background tile actors. If it is then it is supposed to delete itself, but it is not working.
Code: Select all
int qq;
int i;
Actor *actors;

actors = getAllActorsInCollision("Event Actor", &qq);
if(actors)
{
for(i = 0; i < qq; i++)
{
if ( strcmp(actors[i].name, "background_tiles")==1 )DestroyActor("Event Actor");
                        }}

:?:

PostPosted: Thu Jul 26, 2007 3:16 pm
by pixelpoop
wait sorry, I got it now.

strcmp(actors[i].name should be strcmp(actors[i].clonename

and also the actor this script is on can't be created on another actor's create actor script, or nothing happens