---
title: "FindFirstChildWhichIsA()"
description: "Finds the first child that matches a class or one of Glorpia's supported base classes."
canonical: "https://docs.glorpia.com/scripting/functions/find-first-child-which-is-a"
markdown: "https://docs.glorpia.com/scripting/functions/find-first-child-which-is-a.md"
---
# FindFirstChildWhichIsA()

Finds the first child that matches a class or one of Glorpia's supported base classes.

**Category:** Scripting / Method

## Syntax

```luau
instance:FindFirstChildWhichIsA(className, recursive?)
```

## Parameters and return value

| Name | Type | Description |
| --- | --- | --- |
| `className` | string | Class or supported base class to test with IsA(). |
| `recursive` | boolean? | When true, searches descendants instead of only direct children. |
| `return` | Instance or nil | The first matching object, or nil when no match exists. |

> **Note:** Unlike `FindFirstChildOfClass()`, this method uses `IsA()`. For example, a Part can match `"BasePart"`.

## Example: Find Any BasePart

```luau
local firstPart = workspace:FindFirstChildWhichIsA("BasePart", true)

if firstPart then
    print(firstPart:GetFullName())
end
```

## Example: Find A Humanoid

```luau
script.Parent.Touched:Connect(function(hit)
    local character = hit.Parent
    local humanoid = character and character:FindFirstChildWhichIsA("Humanoid")

    if humanoid then
        humanoid:TakeDamage(10)
    end
end)
```

## Related

- [FindFirstChildOfClass()](https://docs.glorpia.com/scripting/functions/find-first-child-of-class.md) — Find a direct child by exact concrete ClassName.
- [IsA()](https://docs.glorpia.com/scripting/functions/is-a.md) — Test an instance against concrete and supported base classes.
- [FindFirstChild()](https://docs.glorpia.com/scripting/functions/find-first-child.md) — Find an object by name.
