questions about using 2D SpriteRenderer along with UI CanvasRenderer

I’m getting deeper into using Unity’s new(er) UI system, and I’m starting to hit some tricky things about combining SpriteRenderer graphics with CanvasRenderer graphics. I’m wondering if there are solutions to these issues, or just generally considerations I need to know about, when building a UI on a 2D game.

In particular, are there good ways to layer sprites when used in the UI? For example, imagine having an animated 2D character in the game, and then wanting to display that animated character on a popup menu. SpriteRenderer has Sorting Layers and Order in Layer, but ui elements are layered by order in hierarchy, which seems incompatible.

They are very different systems. You can’t place a sprite renderer in between ui elements using sorting as the ui combines everything into a batch per canvas which means in essence you have a single mesh per canvas and so placing a sprite in between won’t work. The solution or one solution at least is to place the sprite between 2 canvases and use the sorting value of the canvas to control where the sprite renderer is.

Alright thanks for the info. I wish it worked directly, but the multiple canvas workaround should do for my needs.