Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Error on updating code with particle effect emitters

A topic by PsychoSeel created May 30, 2026 Views: 249 Replies: 7
Viewing posts 1 to 4
(1 edit)

Whenever I change an event that's been emitting particles like:

    part_particles_burst(global.ps_vfx, x, bbox_top + 315, PE_MiningDrill_Smoke);

I'm getting error like this

 called from obj_BOSS_MiningDrill:Step_0 [line 36, col 60]
[GMLive][30-05-2026 15:56:40][ERROR] Runtime error: [error] `instance#ref instance 103824(obj_BOSS_MiningDrill)` (instance of obj_BOSS_MiningDrill) does not have a variable `PE_MiningDrill_Smoke`.

This error is persistent, updating a code with similar code %100 gives error. 

Developer

You could do a live_constant_add in obj_gmlive’s Create event, like so

live_constant_add("PE_MiningDrill_Smoke", PE_MiningDrill_Smoke);

I’ll need to check if asset_ functions work for particle systems in latest GM.

I was also going to come here and say that particles are not supported correctly right now. Every time any code reloads in a section where I'm using a particle system, particle emitter, it begins to error out. Fixes on a reboot of the project.

Developer

I could use a slightly bigger example on what’s going on with emitters as you generate GML for these

(3 edits)

A code section that has anything with particles (I am using a system and burst here) will throw a runtime error. My code looks like this

if object && variable_instance_exists(object, "Take_Hit") {
            var objX = object.x, objY = object.y, objZ = object.z;
            var statuss = object.Take_Hit(inventory[overlayMenuIndex]);
            var sparks = part_system_create_layer(layer, false);
            part_particles_burst(sparks, objX, objY - objZ, psMiningHit);
            if statuss == "Dead" { 
                //Reset highlight list
                Fill_Selectable_List(animDirection);
                highlightableListIndex = 0;
            }
        }

And if I make any change at all in this section, not even to the particle system at all, and then enter it in the game, it throws:

[GMLive][7/8/2026 7:40:09 AM][ERROR] Runtime error: [error] `instance#ref instance 100267(objPlayer)` (instance of objPlayer) does not have a variable `psMiningHit`.

 called from mining changer [line 14, col 61]

Making changes elsewhere works fine. Closing the runner and restarting resolves the runtime error, without changing any code at all. Restarting the room or game doesn't fix it.


I just went and tried your suggestion of adding a live constant. I put live_constant_add("psMiningHit", psMiningHit); in the obj_gmlive and then the live reload during gameplay worked without a hitch.

I am running GameMaker-LTS2026 v2026.0.0.16, Runtime v2026.0.0.23

Developer

I did catch that part, but where’s psMiningHit coming from? How is it defined

Defined in the Particle System Editor. All properties set in GameMaker, not in GML.

Developer(+1)

Did a tweak for this in 1.0.79 - particle system resources should now get auto-exposed to “live” code.