• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Getting simple effects (ef_smoke, ef_explosion, etc) to draw at depth

danielfoutz

Member
GML:
if (choice == 1) {
    effect_create_below(ef_smoke,x,y,0,c_black); }
}
This is the code I'm using in the step event to draw smoke from an object, however, despite using effect_create_below(), the smoke is still being drawn above all of my other layers. Should I be using a different event or method to draw the smoke? Ideally I would love to be able to draw it to a specific depth so it can appear between certain parallax layers but for starters I'd like to learn how to get it to properly draw behind everything else.
 

Slyddar

Member
Since it draws at a depth of 100000, unless you have your other layers the same or higher then that value, it is being drawn pretty much as below as it can be. Are you sure you are not creating it elsewhere as well but above? If you comment out the effect, does it stop? Also you have an extra bracket in your example, so might want to check that out.

If you want to create at specific layers, you will need to use the more detailed particle system to define systems, particles and create the particles at the layer you require. There was a recent blog post showing how to use it, which might be useful - https://player.yoyogames.com/blog/444/get-started-with-particles-in-gamemaker-studio-2
 
Last edited:
Top