![gamemaker studio 2 particles gamemaker studio 2 particles](https://marketplacecdn.yoyogames.com/images/assets/8329/screenshots/18663_original.png)
We use code or actions to define the visual aspect of our particle, and then we place it in the "container" so that we can take it out and use it whenever and wherever we need it later. Well, before setting up a system it's important to know a few things.
![gamemaker studio 2 particles gamemaker studio 2 particles](https://www.rigzsoft.co.uk/media/tfx10.png)
![gamemaker studio 2 particles gamemaker studio 2 particles](https://i.ytimg.com/vi/rhELbwE0jB0/maxresdefault.jpg)
GAME MAKER STUDIO 2 PARTICLE EFFECTS CODEįirst is that most of a particle systems code is only ever called once in the game, usually in some type of controller object in the first room or level - this is not always the case, but for the sake of simplicity, we'll be using this scenario for this tech blog as it's the most common way to use particles. We do this because a particle system, once created, stays in memory and is ready to be used at any time, so if you create it more than once it can quickly up the memory usage and cause serious lag, and even has the potential of crashing the game. In this blog we will make a global particle system that can be used by any instance in the game at any time. To start with we need to define the particle system and give it a name so that we can use it. The GML would look like this: global.P_System = part_system_create_layer("Instance_Layer", false) As this is going to be a global system that any object can use we will do it in a controller object or an initialisation script run at the start of the game. Note that using DnD™ we also tick the blend option. This enables additive blending for the particle, which we'll discuss a bit further on in the article. GAME MAKER STUDIO 2 PARTICLE EFFECTS CODE.