Query Commands for Inspecting Your Scene and Assets
Query commands let Vex inspect your scene and project without changing anything. They are read-only tools for understanding current state before making modifications — a critical part of DAP.
Key commands:
scene.objects— Lists all GameObjects with hierarchy. Set a root to see a subtree, set depth to control detail level.object.info— Detailed info about a specific object: components, properties, children, transform. How Vex verifies an object exists before modifying it.object.find— Search by name, tag, or component type. Finds objects when you know what they have but not where they are.assets.list— Lists assets by path, type, or extension. Great for finding prefabs, materials, scripts.workspace.find— File and folder search by pattern. The primary discovery tool in DAP.
Why queries matter: Before modifying anything, Vex queries first. This prevents adding duplicate components, modifying nonexistent objects, or creating files that already exist.
Example: You say “Add a Rigidbody to the player.” Vex does not blindly add it. Instead:
object.find name="Player"— verify Player existsobject.info target="Player"— check existing components- Only if no Rigidbody:
component.add target="Player" type="Rigidbody" - Reports: “Added Rigidbody to Player.”
Vex verifies, then acts. That is what makes results reliable.
Scene hierarchy inspection:
The scene.objects command is powerful for understanding complex scenes. You can set a root object to see only a specific subtree (like all children of a “UI” parent object), and set a depth limit to control how much detail you get. For large scenes with hundreds of objects, limiting the depth keeps the response manageable.
The workspace.find command:
workspace.find is the primary discovery tool in the Deliberate Action Protocol. It searches for files and folders by pattern with type filtering (file, folder, or any) and result limits (default 100, max 500). Vex calls this before almost every file operation to verify paths and understand the current project structure. You can set a Project Root Preference in Dashboard Settings to focus searches on your main code folder.
Query commands are always safe:
Query commands are read-only. They inspect your project without modifying anything. This means they are safe to use freely, even in Cautious autonomy mode. Vex uses them extensively during the DISCOVER step of DAP to gather facts before taking action.