{"name":"remoteControl","operator":null,"title":"remoteControl","type":"command","url":"https://community.bistudio.com/wiki/remoteControl","revid":373364,"updated":"2025-04-30T13:23:33Z","groups":["Remote Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Switches on remote control of the unit. The command was Global Argument prior to Arma 3 v2.14). For more info see Remote Control Tutorial.\n\nIf the drone is remote it will get transferred to the player's PC.\n\n> [!NOTE]\n> See also remoteControlled, isRemoteControlling, and #Example 4 for a getter workaround for earlier game versions.\n\n> [!WARNING]\n> Always use switchCamera first (when needed) before using remoteControl as doing it after may lead to unpredictable results.","syntaxes":[{"syntax":"who remoteControl whom","since":null,"effect":null,"exec":null,"params":[{"name":"who","type":"Object","optional":false,"default":null,"description":"controlling unit","types":["Object"],"since":null,"text":"who: Object - controlling unit"},{"name":"whom","type":"Object","optional":false,"default":null,"description":"controlled unit","types":["Object"],"since":null,"text":"whom: Object - controlled unit"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"who","types":["Object"]},"right":{"text":"whom","types":["Object"]}}],"examples":[{"text":"Set player remote control of driver:\n\n```sqf\ndriver UAV switchCamera \"Internal\"; // switchCamera required\nplayer remoteControl driver UAV;\n// sometimes switchCamera is not needed\nplayer remoteControl driver UAV;\n```","code":["driver UAV switchCamera \"Internal\"; // switchCamera required\nplayer remoteControl driver UAV;\n// sometimes switchCamera is not needed\nplayer remoteControl driver UAV;"]},{"text":"Return control to player: \n\n> [!IMPORTANT]\n> This method will not work if unit is dead, use the method in Example 3 instead\n\n```sqf\nobjNull remoteControl driver UAV;\n```","code":["objNull remoteControl driver UAV;"]},{"text":"Arma 3 v2.14 Return control to player:\n\n```sqf\nplayer remoteControl objNull;\n```","code":["player remoteControl objNull;"]},{"text":"A dirty hack to return controlling unit because of the absence of dedicated getter:\n\n```sqf\nSQF_fnc_remoteControlledBy =\n{\n    params [\"_obj\"];\n    if (!isNull objectParent _obj) exitWith { UAVControl _obj select 0 };\n    private _res = [objNull];\n    isNil\n    {\n        private _pos = getPosWorld _obj;\n        private _dirUp = [vectorDirVisual _obj, vectorUpVisual _obj];\n        private _anim = animationState _obj;\n        private _dummy = \"PaperCar\" createVehicleLocal [0,0,0];\n        _obj moveInAny _dummy;\n        _res = uavControl _dummy;\n        _obj setPosWorld _pos;\n        _obj setVectorDirAndUp _dirUp;\n        _obj switchMove _anim;\n        deleteVehicle _dummy;\n    };\n    _res select 0\n};\n```\n\nUsage (could be scheduled or unscheduled):\n\n```sqf\n0 spawn\n{\n    player remoteControl bob;\n    systemChat str (bob call SQF_fnc_remoteControlledBy); // B Alpha 1-1:1 (KK)\n    objNull remoteControl bob;\n    systemChat str (bob call SQF_fnc_remoteControlledBy); // <NULL-object>\n};\n```","code":["SQF_fnc_remoteControlledBy =\n{\n\tparams [\"_obj\"];\n\tif (!isNull objectParent _obj) exitWith { UAVControl _obj select 0 };\n\tprivate _res = [objNull];\n\tisNil\n\t{\n\t\tprivate _pos = getPosWorld _obj;\n\t\tprivate _dirUp = [vectorDirVisual _obj, vectorUpVisual _obj];\n\t\tprivate _anim = animationState _obj;\n\t\tprivate _dummy = \"PaperCar\" createVehicleLocal [0,0,0];\n\t\t_obj moveInAny _dummy;\n\t\t_res = uavControl _dummy;\n\t\t_obj setPosWorld _pos;\n\t\t_obj setVectorDirAndUp _dirUp;\n\t\t_obj switchMove _anim;\n\t\tdeleteVehicle _dummy;\n\t};\n\t_res select 0\n};","0 spawn\n{\n\tplayer remoteControl bob;\n\tsystemChat str (bob call SQF_fnc_remoteControlledBy); // B Alpha 1-1:1 (KK)\n\tobjNull remoteControl bob;\n\tsystemChat str (bob call SQF_fnc_remoteControlledBy); // <NULL-object>\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["switchCamera","selectPlayer","UAVControl","remoteControlled","isRemoteControlling","cameraOn","focusOn"],"notes":[{"user":"TeRp","date":"2009-06-04T18:55:00Z","text":"You must use switchCamera in order to remote control a unit.\n\nYou can only remoteControl characters, e.g. if yo want to remote control a car, you have to add a driver and use\n\n```sqf\nplayer remoteControl driver someVehicle\n```"},{"user":"Lou Montana","date":"2010-01-25T14:35:00Z","text":"**Arma 2 v1.05**:\n- You can remoteControl multiple units at the same time.\n- It is not needed to switchCamera to the unit to be able to control it - it is needed to be able to fire with.\n- The switchCamera is fixed : the player can't change internal/external/optics view.\n- Do not think about it like a selectPlayer: it is used to give the control to **the vehicle role the unit is in**.\n- switchCamera to the **vehicle** the unit is in; the camera will go depending the role you are remoteControlling.\n- The AI driver won't follow your vehicle move orders.\n- If the player dies, the death screen will appear, not automatically turning back to the player.\n- If you want to stop the remote control, use objNull as remote controller.\n- Example:\n\n```sqf\nplayer remoteControl driver jeep1;        // will remoteControl it, you still will have full control of the player\njeep1 switchCamera \"internal\";            // fix the camera to the vehicle and not to driver jeep1!\nwaitUntil { !(alive jeep1) || !(alive player) };\nobjNull remoteControl driver jeep1;        // removes the remoteControlling\nplayer switchCamera \"internal\";            // returns to the player\n```"},{"user":"thedawnofallwars","date":"2020-09-17T03:01:00Z","text":"Far and away the easiest way to check the unit remote controlling an AI through Zeus' Remote Control module is using BIS_fnc_moduleRemoteControl_owner\nThis will return the unit in question which you can then run name on to find the controller's name.\n\n```sqf\nprivate _name = \"-\";\n_who = _unit getVariable [\"BIS_fnc_moduleRemoteControl_owner\", objNull];\nif (!isNull _who) then\n{\n    _name = name _who;\n};\n```"}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Remote Control","Introduced with Arma 2 version 1.00","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}