> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getinstances

Returns every Instance Roblox is keeping alive on the client, including ones with no parent in the game hierarchy.

```luau theme={null}
getinstances(): {Instance}
```

The result mixes two groups in one table: Instances reachable through `game` (`workspace`, `Players`, the rest of the visible hierarchy), and Instances that exist in memory but have their `Parent` set to `nil`.

Common usage: locate an Instance by name when you don't know its path in the hierarchy.

## Returns

`{Instance}` - an array of every Instance the client is currently holding alive. Order is not guaranteed.

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local instances = getinstances()
  =======
  -- getinstances(): {Instance}
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  for _, inst in ipairs(getinstances()) do
      if inst.Name:find("your_marker") then
          print(`{inst.ClassName}: {inst:GetFullName()}`)
      end
  end
  ```
</CodeGroup>

<Tip>
  Introspects the entire game engine, including nil-parented objects.
</Tip>
