• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Created exists instance is replaced by other created instance

M

Mr.LuGr

Guest
Hello I need help with my code because I tried everything what can I do with my skills and I don't know how to fix it...

here is problem: https://imgur.com/a/P4iHi6c
Just when particles (object/instance) exist and also created new one, exist particles is replaced by new one.

Code:
DRAW (o_particle):
draw_sprite_part(sprite_index,0,spriteA,spriteA,spriteB,spriteB,x,y);


Destroy(Block):

var i=random(5);
for (i=0;i<20;i+=1)
{
instance_create(x,y,o_particles);
o_particles.sprite_index=sprite_index;

}
I tried any combination with "with" statement and nothing worked.
Thanks for any reply.
 
Code:
with (instance_create(x,y,o_particles))
    sprite_index = other.sprite_index;
or
Code:
var _inst              = instance_create(x,y,o_particles);
    _inst.sprite_index = sprite_index;
 
M

Mr.LuGr

Guest
Code:
with (instance_create(x,y,o_particles))
    sprite_index = other.sprite_index;
or
Code:
var _inst              = instance_create(x,y,o_particles);
    _inst.sprite_index = sprite_index;
I tried this by myself already and doesn't work. :/
 
Would you mind posting your exact implementation? Unless you have conflicting code elsewhere, either of the two should do the job.
 
Top