GML Tile map appears below my sprites

S

steveyg90

Guest
Hi,
I'm busy tonight lol. I created 100 objects which move across the screen left to right in random positions, now these always appear at the top above everyhing, I've tried changing depth but to no avail.

Code:
for(var i=0;i<100;i++) {
    xpos = random_range(0,900);
    ypos = random_range(0,800);
    instance_create_depth(xpos,ypos,0,o_Rain);
}
The above code is ran once to create 100 o_Rain objects. In the o_Rain object in its create event I set the depth so they should be at the back, but still they are appearing in front of my player object and my tiles.
I have the o_Rain objects drawn in Draw GUI event so I guess this could be why, but if I don't do this they also move with the scrolling of my game.

Any help is appreciated here.
 
T

ThePropagation

Guest
What are the depths of your layers in the room. if the depths are more than 0 they should be behind your rain. draw GUI automatically puts them in front though.
 
S

steveyg90

Guest
What are the depths of your layers in the room. if the depths are more than 0 they should be behind your rain. draw GUI automatically puts them in front though.
Tile layer I create here with depth of 0, I've tried changing it.
Code:
global.ground_layer=layer_create(0);
So, draw GUI will always appear in front regardless of you setting the objects depth?
 
Top