wait_for_selector
Poll until a GameObject matching a U-Selector (same syntax as query_objects) reaches a state, or until timeout. States: attached (exists, even inactive), detached (no match), visible (active in hierarchy and rendered/shown), hidden (no match or not visible), interactable (visible and accepts interaction). Use it after actions whose effect appears a few frames later, such as entering Play Mode or clicking UI, instead of sleeping. Returns the matched object’s path, or an error on timeout.
Category: Query
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
selector |
string | yes | U-Selector query string | |
state |
string | "visible" |
Expected state to wait for. One of: attached, detached, visible, hidden, interactable |
|
timeout |
number | 5 |
Maximum time to wait in seconds | |
poll_interval |
number | 0.1 |
Time between checks in seconds |
Example call
Section titled “Example call”The arguments below are the required ones; add the optional ones you need.
{ "name": "wait_for_selector", "arguments": { "selector": "…" }}In SuperSave mode
Section titled “In SuperSave mode”When Unity runs with NANORA_MCP_SUPERSAVE=1, call it through the execute meta tool: {"tool": "wait_for_selector", "args": { … }}. See SuperSave mode.
Source
Section titled “Source”Generated from Assets/NanoraUnityMCP/Editor/Tools/WaitForSelectorTool.cs (version 1.2.1). The client receives the same schema from tools/list.