# PED::IS_TARGET_PED_IN_PERCEPTION_AREA

- **Hash:** `0x06087579E7AA85A9`
- **Namespace:** PED
- **Runtime name (Lua/JS):** `IsTargetPedInPerceptionArea`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/PED/IS_TARGET_PED_IN_PERCEPTION_AREA

## Signature

```c
BOOL IS_TARGET_PED_IN_PERCEPTION_AREA(Ped ped, Ped targetPed, float p2, float customDistance, float p4, float p5);
```

## Parameters

- `ped` (`Ped`)
- `targetPed` (`Ped`)
- `p2` (`float`)
- `customDistance` (`float`)
- `p4` (`float`)
- `p5` (`float`)

## Returns

`BOOL`

## Description

Returns true if ped is in perception (focused and looking at target ped)
Most float params are -1.f in R* Scripts

## Usage

### Lua

```lua
local retval = IsTargetPedInPerceptionArea(ped, targetPed, p2, customDistance, p4, p5)

-- always available, by hash
local retval = Citizen.InvokeNative(0x06087579E7AA85A9, ped, targetPed, p2, customDistance, p4, p5, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const retval = IsTargetPedInPerceptionArea(ped, targetPed, p2, customDistance, p4, p5);

// by hash
const retval = Citizen.invokeNative('0x06087579E7AA85A9', ped, targetPed, p2 + 0.0000001, customDistance + 0.0000001, p4 + 0.0000001, p5 + 0.0000001, Citizen.returnResultAnyway());
```

### C#

```csharp
bool retval = Function.Call<bool>((Hash)0x06087579E7AA85A9, ped, targetPed, p2, customDistance, p4, p5);
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.

*Sources: alloc8or RDR3 NativeDB.*
