iOS [Solved] Paticle is left when moving to the next room.

C

Changyj

Guest
I want to make the paticle disappear as I move on to the next room.

my code :
----------------------------------------
Create event

Sname=part_system_create()
particle1 = part_type_create();
part_type_shape(particle1,pt_shape_spark);
part_type_size(particle1,0.50,0.80,0,0);
part_type_scale(particle1,3,3);
part_type_color1(particle1,16777215);
part_type_alpha1(particle1,0.8);
part_type_speed(particle1,1,1,0,0);
part_type_direction(particle1,100,359,0,0);
part_type_gravity(particle1,0,270);
part_type_orientation(particle1,0,0,0,0,1);
part_type_blend(particle1,1);
part_type_life(particle1,80,120);

emitter1 = part_emitter_create(Sname);
part_emitter_region(Sname,emitter1,x,x,y,y,ps_shape_ellipse,1);

alarm[0]=2

-----------------------------------------------------------------------
Aalarm 0

part_emitter_destroy(Sname,emitter1)
instance_destroy()
----------------------------------------
Step event

part_emitter_stream(Sname,emitter1,particle1,2);
----------------------------------------
Room End event

part_emitter_destroy(Sname,emitter1)
part_particles_clear(particle1)
part_system_destroy(Sname)
part_emitter_clear(Sname,emitter1)
----------------------------------------

Help please!
 
B

Becon

Guest
https://docs.yoyogames.com/source/dadiospice/002_reference/particles/particle systems/part_system_destroy.html

Looks right. IDK why your particles is still there.


EDIT:
If you have this code in the system object and it is destroying itself before you get to that line? I've done something like that before.
Maybe set a variable that says basically if GoodToGo = 1 everything is normal and if GoodToGo = 0 then destroy it all and instead of trying to destroy the particle in the room end event, just set the variable? I have seen stranger things. Let me know if I was helpful at all.
 
Last edited by a moderator:
C

Changyj

Guest
https://docs.yoyogames.com/source/dadiospice/002_reference/particles/particle systems/part_system_destroy.html

Looks right. IDK why your particles is still there.


EDIT:
If you have this code in the system object and it is destroying itself before you get to that line? I've done something like that before.
Maybe set a variable that says basically if GoodToGo = 1 everything is normal and if GoodToGo = 0 then destroy it all and instead of trying to destroy the particle in the room end event, just set the variable? I have seen stranger things. Let me know if I was helpful at all.
Thanks! The problem is solved.
In the Alarm event, Instance_destroy() deleted then, it worked!
Thanks!
 
Top