Hello! It's my first time using GM and I ran in to a problem with the depth between two sprites.
PROBLEM:
When I stand in front of a rock it behaves like it should (the rock is under the character and the pickaxe).
BUT when I hover over the rock with the pickaxe; the rock and the selection maker renders over the character, but not the pickaxe. Which it shouldn't.
(the rock and selection marker also seems to render over other stuff, like trees and other rocks, which it shouldn't)
EXPECTED BEHAVIOUR:
I want the selection marker to be under the rock, and I want the Character and Pickaxe to be on top.
In this order:
1. Selection Marker
2. Rock
3. Character
4. Pickaxe
So basically I want it like in the first picture, but with a selection marker UNDER the rock.
GML CODE:
This code is in the Draw event inside the Pickaxe:
if (instance_exists(selectorInstance)){
with (selectorInstance){
draw_sprite_ext( // Draw the Selection marker
S_Selector,
other.selectorFrame,
//x,
//y,
lerp(bbox_right, bbox_left, .5),
lerp(bbox_top, bbox_bottom, .5),
1,
1,
0,
-1,
1
);
draw_self();
}
selectorFrame += .15;
if (selectorFrame >= selectorFrameNumber) selectorFrame -= selectorFrameNumber;
selectorInstance = noone;
}
draw_self();
selectorInstance is just the Rock in this case.
(I added the draw_self's because I don't know what I am doing)