• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

How to properly Get rid of particles


I have created a simple side scrolling platformer, where the player has particles emitting from the back. Every time the player dies, I use room_restart(). But the Particles are still showing from the previous run, unless I close the game and re-run it. I was wondering how to get rid of them and whether the code used to get rid of them will go in the particles script or the the player script? I looked it up somewhere else and used the code in the player script right before the room_restart(), and I get the error "
global variable name 'part1_emit' index (100006) not set before reading it.
at gml_Object_oPlayer_Step_0 (line 34) - part_emitter_destroy(global.part1_sys, global.part1_emit);