How do I sort sprites by relative positions of bounding boxes?

By default, Unity gives you the options between the center of each sprite itself and wherever you assign a pivot point.

Like, when you have objects with diagonal sides of their bounding boxes, I would like my character to be displayed in full when her bounding box lies below that side of that object’s box, and to be at least partially obscured when her box lies above that side, regardless of how much further up or down the screen the latter’s box reaches.

For instance, try picturing a table shown clockwise at a 15-degree angle. If she’s standing behind its front-left corner, even though her entire sprite lies below the table’s center vertically, she would still be partially obscured. Conversely, if she were standing in front of its back-right corner, despite standing above its center, she would take priority.

How would I go on about programming something like that?

No idea. But if you have any questions about FMOD we’d be happy to help :slight_smile:

1 Like