# Sandbox.Component.GetComponentInParent

```csharp
T GetComponentInParent(bool includeDisabled = False, bool includeSelf = True)
```

Get component on this GameObject and on ancestor GameObjects

### Parameters

- `includeDisabled` (`bool`), default `False`
- `includeSelf` (`bool`), default `True`

### Returns

`T`

Declared in [Sandbox.Component](/api/Sandbox.Component).
Assembly: `Sandbox.Engine`.
