Sprite layering issue from camera



the weapon sprites aren’t layering properly; the sprite components’ Y position is constant between the two images, but somehow the weapon is behind in one image and in front in the other.
I’ve tried using the Translucency Sort Priority; while it worked, the spears are long enough that they’d overlap other characters at a different angle. I’d have to recalculate TSP for each character every time the camera moves or rotates to fix that.
The only other option I have is baking the weapons into the procedural sprite sheets; the problems there are it would require expanding the sprites to allow for spears (which would require recalculating placements of things in the sprite sheet), and that currently I can only generate the sprite sheets in BP, and it’s already a mess of nodes and connections without the weapons. If I could do it in C++, it would be a bit more tolerable, but Crash on HotReload "Tried to get the current ObjectInitializer, but none is set".

potentially relevant info:
-each character consists of a flipbook component for the body, two sprite components for the weapons, and a flipbook component for the hands so that they’re always in front of the weapons.
-the weapon sprites positions are determined by sockets in the sprites, including Y values. I’ve tried changing the components’ relative Y values on top of moving them to the appropriate sockets: no luck.

have you tried switch material from translucent to masked?

just tried; end up with “z-fighting” artifacts.

increasing the offset of the weapon sprite fixed it. Had been avoiding that at first because it was causing a screen-Y offset (in spite of how it should have been straight towards the camera); but, with offset on the weapons and TSP for the hands, it’s barely noticeable.

EDIT: SCRATCH THAT, THE SCREEN-XY OFFSET IS VARYING BASED ON WHERE THE PAWN IS ON SCREEN WHEN ROTATING THE CAMERA. MOVING THE CAMERA DOESN’T AFFECT IT.

EDIT2: camera facing code was perspective when it should have been orthographic.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.