M
Mikael.K
Guest
Maybe i'm effing stupid or something but i can't get instance_deactivate_object to work.
I have an object called obj_spawn. I want it to spawn an enemy after it's animation has played, then deactivate itself.
This is the only code i have in it.
Animation End:
instance_create_layer(x,y,"characters",obj_enemy)
instance_deactivate_object(self);
It keeps spawning endless enemies. I even tried putting the code in the Create Event. Still won't deactivate.
Tried "instance_deactivate_object(object id)" in the Create Event of another object. Still won't deactivate.
I have used instance_deactivate_object before, never had a problem. What am i doing wrong?
I have an object called obj_spawn. I want it to spawn an enemy after it's animation has played, then deactivate itself.
This is the only code i have in it.
Animation End:
instance_create_layer(x,y,"characters",obj_enemy)
instance_deactivate_object(self);
It keeps spawning endless enemies. I even tried putting the code in the Create Event. Still won't deactivate.
Tried "instance_deactivate_object(object id)" in the Create Event of another object. Still won't deactivate.
I have used instance_deactivate_object before, never had a problem. What am i doing wrong?