2D Sprite Layering?

Is there a way to draw sprites on top of other sprites like layers? The problem is that I have two sprites, a player sprite and a sword sprite. When the two separate sprites come together one Is drawn on top of the other at random. And looks like this: alt text

As you can clearly see this is a huge problem. I thought about just moving the sword in front of the player by a very small decimal but that seems kinda sloppy and annoys my OCD with unclean numbers.

So can this be done and how?

Thanks!

1 Answer

1

Moving one object in front of the other is correct. It doesn’t matter by how much, since you are presumably using an orthographic camera. So you might as well use whole numbers.