Repository navigation
Availability Filtering
Control whether searches consider inactive or off-screen GameObjects, and how to filter on interactability.
By default a search only returns GameObjects that are:
-
Active —
activeInHierarchyis true. -
On screen — the object has non-empty screen bounds that overlap the screen. Bounds come from a
RectTransform, else an enabledRenderer, else an enabledCollider; objects with none of these (empty parents, managers, cameras) have no bounds and are skipped.
Interactability is not filtered: a Button with interactable = false still matches, so there is no opt-in for non-interactable elements. Use Interactable() to require interactable ones, or With<Selectable>(s => !s.interactable) to find only disabled ones.
IncludeInactive() also searches objects that are SetActive(false) (or under an inactive parent):
// Find a hidden panel
var panel = await Find<RectTransform>(Name("HiddenPanel").IncludeInactive());
Assert.IsFalse(panel.gameObject.activeInHierarchy);IncludeOffScreen() drops the on-screen requirement. Use it for objects outside the camera view, scrolled out of the screen, or with no visual bounds at all:
// A manager object with no Renderer / RectTransform
var manager = await Find<Transform>(Name("GameManager").IncludeOffScreen());
// 3D object that may be behind the camera
var crate = await Find<Rigidbody>(Name("Crate_07").IncludeOffScreen());Interactable() keeps only objects with a Selectable whose interactable flag is true:
await Click(Type<Button>().Interactable());
// Wait until Submit becomes clickable
await WaitFor(Name("SubmitButton").Interactable(), 5f);It reads Selectable.interactable only — a parent CanvasGroup with interactable = false is not considered. Add a Where predicate if you need that:
await Click(
Type<Button>().Where(go => go.GetComponent<Selectable>().IsInteractable())
);// Default search already finds non-interactable buttons
var submitBtn = await Find<Button>(Name("SubmitButton"));
Assert.IsFalse(submitBtn.interactable, "Submit should be disabled");
// Fill the form, then wait for it to become interactable
await TextInput(Adjacent("Email:"), "test@example.com");
await WaitFor(Name("SubmitButton").Interactable(), 5f);Find<T> fails the test when nothing matches unless you pass throwIfMissing: false, in which case it returns null:
var optional = await Find<Button>(Name("PromoButton"), throwIfMissing: false, seconds: 2f);
if (optional != null && !optional.interactable)
{
Debug.Log("Promo button exists but is disabled");
}// It exists (even if inactive)...
await Find<Transform>(Name("ResultPanel").IncludeInactive());
// ...then wait up to 10 s for it to become active
await WaitFor(Name("ResultPanel"), 10f);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