[Feature Request][PAPER2D] Set Sprite Sort Order by Axis Perpendicular to Camera Axis

In order to make a top down game like Zelda or a beat-em up game like Golden Axe, where the game exists on a single plane, but depth is simulated by drawing sprites that are closer to the bottom of the screen on top of those closer to the top of the screen, we currently have two options: 1. Move sprites equally in both the screen-up axis and the toward-camera axis. 2. Use only translucent sprite materials and set the Translucency Sort Priority.

A simpler solution would be to sort sprites based on where they sit on the screen-up axis. It would have to based on the sprites lowest point on that axis, instead of some center point of the sprite, or else smaller sprites could potentially draw over larger sprites when they logically shouldn’t.

this can be achieved by creating a blueprint with a scene component, add a sprite component, move scene component to sprite point of Y axis of choice. on construction -> set sprite z order translucency to the (World)Y position of that scene component.

That’s pretty much what I meant in option 2 above. Might not even have to do that explicitly like that since there is an axis sort priority option in the project settings. But there is no such method for Masked and Opaque sprite materials. They only use the camera axis. Now, there may be no problem whatsoever using only translucent sprite materials. I don’t know if translucent sprite materials have additional overhead, or introduce other quirks that need a work around. I had been using Masked/Opaque and moving them in and Y and Z equally. But I am going to play around with all translucent materials soon and I guess I’ll find out. I’m curious what defines the sprites location in the axis. Bottom bounds? Center Point? Pivot Point? I’ll find out.

edit:

Yeah, it’s the center of the sprite, and changing the pivot to bottom-center doesn’t change the sort behavior. Works well if all of your sprites are the same size. No need to set sort priority in blueprints at all in that case. But if you are going to have giant ogre sprites and trees, they aren’t sorted properly.

edit2:

Okay I think I got it now. Moving the Sprite or Flipbook component so that it sits above the scene root and checking Use Attached Parent’s Bound does the trick. No need to set Sort Priority on tick in BluePrint at all.

So I guess UE4 already has this feature as long as you are using translucent materials for your sprites.

edit3:

Okay so that doesn’t work exactly. When the scene root goes out of camera view the sprite disappears like so: - YouTube