---
name: "BIS_fnc_lookAtArray"
type: function
status: ok
groups: ["Interaction"]
arma3_since: "1.78"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_lookAtArray
revid: 348199
updated: 2023-11-08T11:40:09Z
---

# BIS_fnc_lookAtArray

*Function · Interaction · Arma 3 v1.78*

## Description

Executes a code when one of the specified objects is looked at (player's cursor pointed towards it) for enough time

## Syntax

```sqf
[initialize, lookAtData] call BIS_fnc_lookAtArray
```

**Parameters:**

- `initialize`: [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to initialize, [false](../commands/false.md) to remove it
- `lookAtData`: [Array](../topics/Array.md) - an array with arrays of look-up-data in form of:
  - 0: [Object](../topics/Object.md) - Object to be looked at
  - 1: [Number](../topics/Number.md) - How long player has to look at it
  - 2: [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to remove it from array when player looked at it
  - 3: [Code](../topics/Code.md) - Code spawned when player looked long enough at the object

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
private _lookAtArray = 
[
    [
        BIS_apc,                                        // name of object
        2,                                                // time we have to look at it
        false,                                            // do we destroy the entry after we looked at it
        { ["What a wonderful APC"] call BIS_fnc_log; }    // code
    ],
    [
        BIS_otherUnit, 
        2,
        false,
        { ["apc looked at"] call BIS_fnc_log; }
    ]
];
[true, _lookAtArray] spawn "BIS_fnc_lookAtArray";
sleep 15;
[false] spawn "BIS_fnc_lookAtArray";
```

## See also

[BIS_fnc_lookAtArrayEH](../functions/BIS_fnc_lookAtArrayEH.md)

<sub>Source: [BI Community Wiki — BIS fnc lookAtArray](https://community.bistudio.com/wiki/BIS_fnc_lookAtArray) (revision 348199).</sub>
