uloop find-game-objects
Find GameObjects with search criteria or get details for currently selected Hierarchy objects.
Use this before execute-dynamic-code when identifying or inspecting selected GameObjects. Use get-hierarchy instead when you need the child tree, parent-child structure, or descendants under the selection.
Usage
uloop find-game-objects [options]
Parameters
| Parameter |
Type |
Default |
Description |
--name-pattern |
string |
- |
Name pattern to search |
--search-mode |
string |
exact |
Search mode: exact, path, regex, contains, selected |
--required-components |
array |
- |
Required components |
--tag |
string |
- |
Tag filter |
--layer |
integer |
- |
Layer filter (layer number) |
--max-count |
integer |
20 |
Maximum number of results |
--include-inactive |
flag |
- |
Include inactive GameObjects |
--include-inherited-properties |
flag |
- |
Include inherited properties in results |
Search Modes
| Mode |
Description |
exact |
Exact name match (default). Trap: --name-pattern "Camera" will not match a GameObject named "Main Camera" — use contains or regex for partial matching. A zero-hit exact search returns a Message hint pointing this out. |
path |
Hierarchy path search (e.g., Canvas/Button) |
regex |
Regular expression pattern |
contains |
Partial name match |
selected |
Get currently selected GameObjects in Unity Editor |
Output
Returns JSON with:
Results (array): Matching GameObjects, each containing:
Name (string): GameObject name
Path (string): Hierarchy path (e.g., Canvas/Panel/Button)
IsActive (boolean): Active state in hierarchy
Tag (string): GameObject tag
Layer (number): Layer index
Components (array): Each entry has Type (short name, e.g., Rigidbody), FullTypeName (e.g., UnityEngine.Rigidbody), and Properties (array of Inspector-visible {Name, Type, Value} pairs)
TotalFound (number): Results returned (after --max-count clipping). For multi-selection file export, this is the number exported.
ErrorMessage (string): Top-level failure summary (empty on success)
ProcessingErrors (array): Selected-mode per-GameObject serialization failures, each {GameObjectName, GameObjectPath, Error}. Omitted/null or empty on clean runs.
Multi-selection file export
For selected mode with multiple successfully serialized GameObjects, inline Results is not populated and the data is written to a file instead. Two extra fields appear:
ResultsFilePath (string): Relative path under .uloop/outputs/FindGameObjectsResults/
Message (string): Human-readable summary (e.g., "5 GameObjects exported")
Single-selection and search-mode calls (exact, path, regex, contains) always return inline. No selection (selected mode with empty selection) returns empty Results plus a Message.
1---2name: uloop-find-game-objects3toolName: find-game-objects4description: "Find or inspect Unity GameObjects, especially objects the user currently selected in the Hierarchy. Use for details, components, tags, layers, or name/path searches."5metadata:6 source: https://skillmd.com/skills/hatayama/uloop-find-game-objects7---89# uloop find-game-objects1011Find GameObjects with search criteria or get details for currently selected Hierarchy objects.1213Use this before `execute-dynamic-code` when identifying or inspecting selected GameObjects. Use `get-hierarchy` instead when you need the child tree, parent-child structure, or descendants under the selection.1415## Usage1617```bash18uloop find-game-objects [options]19```2021## Parameters2223| Parameter | Type | Default | Description |24|-----------|------|---------|-------------|25| `--name-pattern` | string | - | Name pattern to search |26| `--search-mode` | string | `exact` | Search mode: `exact`, `path`, `regex`, `contains`, `selected` |27| `--required-components` | array | - | Required components |28| `--tag` | string | - | Tag filter |29| `--layer` | integer | - | Layer filter (layer number) |30| `--max-count` | integer | `20` | Maximum number of results |31| `--include-inactive` | flag | - | Include inactive GameObjects |32| `--include-inherited-properties` | flag | - | Include inherited properties in results |3334## Search Modes3536| Mode | Description |37|------|-------------|38| `exact` | Exact name match (default). **Trap**: `--name-pattern "Camera"` will not match a GameObject named `"Main Camera"` — use `contains` or `regex` for partial matching. A zero-hit `exact` search returns a `Message` hint pointing this out. |39| `path` | Hierarchy path search (e.g., `Canvas/Button`) |40| `regex` | Regular expression pattern |41| `contains` | Partial name match |42| `selected` | Get currently selected GameObjects in Unity Editor |4344## Output4546Returns JSON with:4748- `Results` (array): Matching GameObjects, each containing:49 - `Name` (string): GameObject name50 - `Path` (string): Hierarchy path (e.g., `Canvas/Panel/Button`)51 - `IsActive` (boolean): Active state in hierarchy52 - `Tag` (string): GameObject tag53 - `Layer` (number): Layer index54 - `Components` (array): Each entry has `Type` (short name, e.g., `Rigidbody`), `FullTypeName` (e.g., `UnityEngine.Rigidbody`), and `Properties` (array of Inspector-visible `{Name, Type, Value}` pairs)55- `TotalFound` (number): Results returned (after `--max-count` clipping). For multi-selection file export, this is the number exported.56- `ErrorMessage` (string): Top-level failure summary (empty on success)57- `ProcessingErrors` (array): Selected-mode per-GameObject serialization failures, each `{GameObjectName, GameObjectPath, Error}`. Omitted/null or empty on clean runs.5859### Multi-selection file export6061For `selected` mode with **multiple** successfully serialized GameObjects, inline `Results` is not populated and the data is written to a file instead. Two extra fields appear:6263- `ResultsFilePath` (string): Relative path under `.uloop/outputs/FindGameObjectsResults/`64- `Message` (string): Human-readable summary (e.g., "5 GameObjects exported")6566Single-selection and search-mode calls (`exact`, `path`, `regex`, `contains`) always return inline. No selection (`selected` mode with empty selection) returns empty `Results` plus a `Message`.