• 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!

GML SOLVED Need help changing object depth during sprite animation

A

anthropus

Guest
I have 2 sprite-objects: the player one and a magic spell one and I want the magic spell sprite-object to
"wrap around" the player.

to accomplish this I want the first few subimages of the magic spell sprite-object to draw behind the player object, and the rest of the magic spell subimages to draw in front of the player, thus creating a 'wrapping around the player' effect

the player object has a depth of 0; it creates the magic spell object; atm the magic spell only draws behind the player.

this code i tried does not work and Im out of ideas (its in the step event of the parent object of the magic spell object).
Code:
//change depth of magic sprite to wrap around the caster
if (image_index > 2)
{
depth=20;
}
thanks
 
A

anthropus

Guest
as I wrote this post i figured it out lol. delete if necessary

I should have put -20 for depth

lol noob problems
 
Top