How to properly Get rid of particles

Discussion in 'Programming' started by Jeff, May 16, 2019.

  1. Jeff

    Jeff Member

    Oct 4, 2017
    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);
  2. TheSly

    TheSly Member

    Jan 16, 2017
    You can use part_particles_clear() to clear a particular particle system.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice