1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

How to properly Get rid of particles

Discussion in 'Programming' started by Jeff, May 16, 2019 at 2:52 AM.

  1. Jeff

    Jeff Member

    Joined:
    Oct 4, 2017
    Posts:
    5
    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

    Joined:
    Jan 16, 2017
    Posts:
    830
    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