Is it possible to change the order of objects through a script? The example in the screenshot. Or is it possible to add an object (also through a script) not to the end of the list, but to the beginning? scr

  • I noticed that the order of the objects on the canvas depends on the position in the queue. For an object to be in the foreground, it must be higher - Nikita Medvedev
  • In ... an important clarification that it is necessary for the UI (it was desirable in the question and indicate exactly what interests it). If no one answers - I will try to write tomorrow - Alexey Shimansky

1 answer 1

Need to use the following method

gameobject.transform.SetAsFirstSibling();