focusOn: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Add example)
Line 14: Line 14:
|r1= [[Object]] - person
|r1= [[Object]] - person


|x1= <sqf>_object = focusOn;</sqf>
|x1= <sqf>private _currentlyControlledUnit = focusOn;</sqf>
 
|x2= <sqf>
if (isNull player) exitWith { /* no player */ };
if (player == focusOn) then
{
systemChat "You are controlling your player unit.";
}
else
{
systemChat "You are remote-controlling a unit";
};
</sqf>


|seealso= [[switchCamera]] [[cameraView]] [[cameraEffect]] [[cameraOn]] [[remoteControl]]
|seealso= [[switchCamera]] [[cameraView]] [[cameraEffect]] [[cameraOn]] [[remoteControl]]
}}
}}

Revision as of 19:03, 5 September 2023

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.16.

Description

Description:
Returns the person the camera is focused on. If you need the vehicle, see cameraOn.
Groups:
Camera ControlRemote Control

Syntax

Syntax:
focusOn
Return Value:
Object - person

Examples

Example 1:
private _currentlyControlledUnit = focusOn;
Example 2:
if (isNull player) exitWith { /* no player */ }; if (player == focusOn) then { systemChat "You are controlling your player unit."; } else { systemChat "You are remote-controlling a unit"; };

Additional Information

See also:
switchCamera cameraView cameraEffect cameraOn remoteControl

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note