Repository navigation
Search.Path
ODD Games edited this page Oct 14, 2026
·
3 revisions
Find GameObjects by their full hierarchy path.
// Shortcut (using static ODDGames.BugpunchSdk.ActionExecutor)
Path(string pattern)
// Chainable method on any Search
new Search().Path(string pattern)| Parameter | Type | Description |
|---|---|---|
pattern |
string | Hierarchy path pattern (supports * wildcards and ` |
Each object's path is built from the scene root down, with a leading /:
Scene Hierarchy:
Canvas
├── MainMenu
│ ├── Title
│ └── Buttons
│ ├── PlayButton
│ └── SettingsButton
└── SettingsPanel
└── Title
Paths:
/Canvas/MainMenu/Title
/Canvas/MainMenu/Buttons/PlayButton
/Canvas/SettingsPanel/Title
The pattern is matched against the whole path. * matches any run of characters — including /, so it can span several levels. In practice, start patterns with / (exact from the root) or * (anchor anywhere).
| Pattern | Matches |
|---|---|
/Canvas/MainMenu/Title |
Only MainMenu's Title |
*/PlayButton |
Any object named PlayButton
|
*/MainMenu/* |
Every descendant of MainMenu, at any depth |
*/Buttons/*Button |
Children (or deeper) of Buttons whose name ends in Button
|
Canvas/MainMenu/Title |
Nothing — missing the leading /
|
// Exact path from the root
await Click(Path("/Canvas/MainMenu/Buttons/PlayButton"));
// Anchored on the tail
var label = await Find<Text>(Path("*/HUD/ScorePanel/ScoreLabel"));
// Anything below MainMenu
await Click(Path("*/MainMenu/*").Type<Button>().First());// Two panels both contain a "Title"
await Click(Path("*/SettingsPanel/Header/Title"));
await Click(Path("*/ProfilePanel/Header/Title"));The same can be expressed structurally with Name("Title").HasAncestor("SettingsPanel") (see Search.Hierarchy), which survives intermediate objects being added or renamed.
| Scenario | Recommendation |
|---|---|
| Disambiguate same-named elements |
Path or HasAncestor
|
| Find element by unique name | Name |
| Find element by display text | Text |
| Stable reference to a nested element | Path |
// Path with component state
var button = await Find<Button>(
Path("*/MainMenu/Buttons/*").With<Button>(b => b.interactable)
);
// Include inactive objects
var hidden = await Find<Transform>(Path("*/HiddenPanels/*").IncludeInactive());
// Restrict to a screen region
await Click(Path("*/Buttons/*").InRegion(ScreenRegion.Center).First());Basic Filters
Proximity
Hierarchy
Spatial
Ordering
Modifiers
Combining
Reflection
- Test Actions
- Click Actions
- Text Input
- Drag Actions
- Gesture Input
- Wait and Find
- Assertions
- GameObject Manipulation