Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How can I efficiently organize by UI in the hierarchy?

Discussion in 'UGUI & TextMesh Pro' started by Phanixis, Dec 15, 2015.

  1. Phanixis

    Phanixis

    Joined:
    Oct 19, 2015
    Posts:
    27
    I am developing a game menu with several sets of UI elements that are roughly arranged in several columns. I think the organization within the scene hierarchy would be cleaner and easier to modify if each column was made the child of an empty game object. The idea being is I could then adjust the position of one of the columns by modifying the transform of a single object.

    The problem is, most game objects use a transform that works different than the transform used by UI elements. What I really is some kind of empty UI element to group each set of functional UI elements under. Multiple canvases would be the obvious candidate except I do not have any control over the canvas transform using the default canvas settings. There just doesn't seem to be any blank UI objects that I can use for this purpose.

    Is there a UI element meant to be used for this particular purpose?

    Thanks for the help.
     
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Why dont you just have the empty game object with a RectTransform on it instead of Transform...
     
  3. Phanixis

    Phanixis

    Joined:
    Oct 19, 2015
    Posts:
    27
    I was not aware you could do that. This is exactly what I was looking for. Thanks for the help.
     
  4. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    You can also use a Panel and disable the image component (which would make it an empty GO with a Rect transform) ;-)
     
    hydraxic likes this.
  5. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    This is just what I do every time. It's a lot easier.
     
  6. liiir1985

    liiir1985

    Joined:
    Jul 30, 2014
    Posts:
    147
    you can just right click on the UI gameobject and then click Create Empty. It'll automatically create a GameObject with RectTransform