Get the direction of a unit’s head.
For anyone except the local player, the head is assumed to be facing straight forward.
|_unit||Unit to check [Object]|
|_object||Relative object/position to get direction to [Object or Position Array, defaults to getting compass direction]|
[<NUMBER>, <NUMBER>, <BOOL>, <BOOL>]
_data = [player] call CBA_fnc_headDir; // => returns direction of head (freelook) _data = [player, house1] call CBA_fnc_headDir; // => returns direction of head, difference angle, if house is in fov // and if 3rd person is on or not _data = [ai] call CBA_fnc_headDir; // => returns the direction of ai (not head) _data = [ai, getPos player] call CBA_fnc_headDir; // => direction of ai, difference towards players pos, if player is in // fov of ai, and 3rd person off (default return)
positionCameraToWorld is only valid for player object, it is not handled for other players or AI!! For these you can only check if its turned towards an object, not looking at it.