docs.unity3d.com
    Show / Hide Table of Contents

    Selection Groups User Documentation

    Overview

    Selection Groups provides a more convenient workflow in Unity by allowing to group a number of GameObjects under a common name.
    This way, we can do operations on these groups, instead of individual GameObjects.

    Getting Started

    1. Open the Selection Groups window via Window > General > Selection Groups.
      We recommend to dock this window next to the Hierarchy window.

    2. Click “Add Group” in the Selection Groups window, and a new item will appear inside the window.

    3. Drag some GameObjects from the hierarchy, or assets from the Project window.

    4. Double click the group name, and a configuration dialog box will appear.

      The dialog box contains the following properties:

      1. Group name
      2. Group color
      3. Data Location
      4. GameObject Query
        Specifies a query which will automatically assign GameObjects from the hierarchy that match the query to the group.
        For example, /Enemy* will select all GameObjects that are in the root of the hierarchy that have names starting with Enemy.
        See the GoQL documentation for more information.
      5. Toolbar Buttons
        Enables/disables the following toolbar items in the main Selection Groups window for the group.

        1. Eye: to show or hide all the GameObjects in the group.
        2. Lock: to enable or disable the editing of all the GameObjects in the group.

    Data Location

    The data of each group can be stored in one of these two locations:

    1. Scene: in a scene (default).
      This allows scripts to access the data.
    2. Editor: in an asset file outside scenes.
      • Merits:
        • allows a decoupling between the groups and the scenes.
        • enables group sharing among multiple scenes.
      • Demerits:
        • the group data cannot be used by scripts.

    Note that the Selection Group window will only show grouped GameObjects that exist in the opened scene.

    When the group data is stored in the Editor, the group saves references to GameObjects using GlobalObjectId API, which provides project-global object identifiers, into an asset file.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023