Bring UI Element to front without modifying the hierarchy

Hello !

First, i’m using Unity 5.6.

Is it possible to bring UI Elements (image, text… etc) on the foreground without modifying the hierarchy (I can’t do it with transform.SetAsLastSibling) ?

I’m developing a game wich is designed like a comic and I need to bring some text bubble in front of everything (some of them must be in front of other boxes).

My hierarchy looks like this :

Comic

Box

Character

TextBubble
Character
TextBubble (this one must be in front of the next box)
Box
Character
TextBubble
Character
TextBubble (this one must be in front of the previous box)

Thanks :slight_smile:

I'm not sure about Unity 5, but in Unity 2017 you can do the following:

&nbsp

Add a Canvas component to each TextBubble and check the box for Override Sorting. That will make an integer field for Sorting Order appear, which you can set to a new value. Greater values are rendered on top of lesser values.

&nbsp

The Sort Order on your base Canvas on Comic is set to 0 by default, so if you set your TextBubble Sort Order to 1, it and any children you attach to it will render on top of objects whose parent Canvas is Comic, even if those other objects are lower in the hierarchy.