{"name":"focusOn","operator":null,"title":"focusOn","type":"command","url":"https://community.bistudio.com/wiki/focusOn","revid":363319,"updated":"2024-03-26T16:41:39Z","groups":["Camera Control","Remote Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.16"}],"since":{"game":"arma3","name":"Arma 3","version":"2.16"},"arma3_since":"2.16","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns the person the camera is focused on. If you need the vehicle, see cameraOn.","syntaxes":[{"syntax":"focusOn","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Object","types":["Object"],"description":"controlled person or objNull if no unit is controlled","text":"Object - controlled person or objNull if no unit is controlled"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\nprivate _currentlyControlledUnit = focusOn;\n```","code":["private _currentlyControlledUnit = focusOn;"]},{"text":"```sqf\nif (isNull player) exitWith { /* no player */ };\n\nif (player == focusOn) then\n{\n    hint \"You are controlling your player unit\";\n}\nelse\n{\n    hint \"You are remote-controlling a unit\";\n};\n```","code":["if (isNull player) exitWith { /* no player */ };\n\nif (player == focusOn) then\n{\n\thint \"You are controlling your player unit\";\n}\nelse\n{\n\thint \"You are remote-controlling a unit\";\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["switchCamera","cameraView","cameraEffect","cameraOn","remoteControl"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Camera Control","Command Group: Remote Control","Introduced with Arma 3 version 2.16","Scripting Commands"]}