2023.1.1175.2 GameObject Query
Overview
The GameObjectQuery tool can select GameObjects present in the scene based on different filter queries.
Where to find
The feature can be found under Prespective Menu > Utilities > Mesh Tools > GameObject Query.
Feature Layout
The image below shows the complete feature layout of the GameObject Query tool.
Field | Value | Description |
---|---|---|
Parent initialization field | GameObject | Use this field to only initialize this object and it’s children, rather than the entire scene |
Initialize All Objects in Scene | Button | Initialized all GameObjects in the scene to query in |
Current Selected Game Objects | GameObject(s) | Every GameObject currently selection |
Exact Similar Mesh | bool | Query option to find objects that use the same mesh |
Mesh Surface Area | bool, int | Query option to find objects who’s mesh have the same surface area* |
Mesh Volume | bool, int | Query option to find objects who’s mesh have the same volume* |
Equal/Smaller (BoundingBox) | bool, int | Query option to find objects who’s mesh are equal or smaller in size* |
Material | bool | Query option to find objects that use the same material |
Name | bool | Query option to find objects that have the same name |
Components on Reference object | bool | Query options generated based on components present on reference object |
*: these options can be configured using the deviation fields that pop up once their respective toggle is ticked. The deviation fields allow the query to deviate (with range 0 - 100%) from the intended behaviour.
How to use
Use case 1: Find all gameobject under Cube (1) that have a BoxCollider component
Define Scope: Drag Cube (1) from the Hierarchy into the Initialize Object Field. All child objects are initialized.
Define Reference Object(s): Select Cube (1) in the hierarchy
Box Collider: Select Box Collider in the Object Filters tab and click Select Matching
Result of the query can be seen down below, every child with a BoxCollider component is now selected
Use case 2: find all bolts in a machine setup
Initialize all objects in the machine
Tick the Mesh Surface Area box, then give a little deviation for different sized bolts
Click Select Matching
Notice how not all of the bolts were found, the 5 visible bolts to the left were out of the deviations reach. Increasing this deviation, then clicking Select Matching again, will find different bolts as well.
Prespective Documentation