{"name":"cameraEffect","operator":null,"title":"cameraEffect","type":"command","url":"https://community.bistudio.com/wiki/cameraEffect","revid":336915,"updated":"2023-01-04T16:43:59Z","groups":["Camera Control"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"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":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"description":"Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use switchCamera instead. The effect type \"Terminate\" is used to exit the current camera view and switch back to the player's view. Does not need camCommit.\n\nSince Arma 3 v1.74, it is possible to terminate individual r2t source. For example:\n\n```sqf\ncam cameraEffect [\"terminate\", \"back\", \"rtt1\"]; // would terminate \"rtt1\" r2t source\ncam cameraEffect [\"terminate\", \"back\"]; // would terminate all r2t sources\n```\n\n> [!IMPORTANT]\n> One cannot mix and match cameraEffect and can either have multiple r2t cameras or a single camera for the whole screen.\n> If one needs a background stream overlayed with r2t streams, this could be achieved by creating an object and using switchCamera to switch to it for background image, while using cameraEffect for r2t overlay (see #Example 4).","syntaxes":[{"syntax":"camera cameraEffect [effectName, effectPosition, r2tName]","since":null,"effect":null,"exec":null,"params":[{"name":"camera","type":"Object","optional":false,"default":null,"description":"object of type \"camera\"","types":["Object"],"since":null,"text":"camera: Object - object of type \"camera\""},{"name":"effectName","type":"String","optional":false,"default":null,"description":"the effect type (defined in main config or CfgCameraEffects >> Array). Defaults are: `\"Internal\"`, `\"External\"`, `\"Fixed\"`, `\"FixedWithZoom\"`, `\"Terminate\"`","types":["String"],"since":null,"text":"effectName: String - the effect type (defined in main config or CfgCameraEffects >> Array). Defaults are: `\"Internal\"`, `\"External\"`, `\"Fixed\"`, `\"FixedWithZoom\"`, `\"Terminate\"`"},{"name":"effectPosition","type":"String","optional":false,"default":null,"description":"position of the effect. Can be one of:\n- `\"TOP\"`\n- `\"LEFT\"`\n- `\"RIGHT\"`\n- `\"FRONT\"`\n- `\"BACK\"`\n- `\"LEFT FRONT\"`\n- `\"RIGHT FRONT\"`\n- `\"LEFT BACK\"`\n- `\"RIGHT BACK\"`\n- `\"LEFT TOP\"`\n- `\"RIGHT TOP\"`\n- `\"FRONT TOP\"`\n- `\"BACK TOP\"`\n- `\"BOTTOM\"`\nThese are usually used with \"Fixed\" and \"FixedWithZoom\" effect types. If not sure which position to use, set it to `\"BACK\"`.","types":["String"],"since":null,"text":"effectPosition: String - position of the effect. Can be one of:\n- `\"TOP\"`\n- `\"LEFT\"`\n- `\"RIGHT\"`\n- `\"FRONT\"`\n- `\"BACK\"`\n- `\"LEFT FRONT\"`\n- `\"RIGHT FRONT\"`\n- `\"LEFT BACK\"`\n- `\"RIGHT BACK\"`\n- `\"LEFT TOP\"`\n- `\"RIGHT TOP\"`\n- `\"FRONT TOP\"`\n- `\"BACK TOP\"`\n- `\"BOTTOM\"`\nThese are usually used with \"Fixed\" and \"FixedWithZoom\" effect types. If not sure which position to use, set it to `\"BACK\"`."},{"name":"r2tName","type":"String","optional":true,"default":null,"description":"Render To Texture surface reference","types":["String"],"since":null,"text":"r2tName: String - (Optional) Render To Texture surface reference"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"camera","types":["Object"]},"right":{"text":"[effectName, effectPosition, r2tName]","types":["Array"]}}],"examples":[{"text":"```sqf\n_cam cameraEffect [\"internal\", \"BACK\"];\n```","code":["_cam cameraEffect [\"internal\", \"BACK\"];"]},{"text":"```sqf\n_cam cameraEffect [\"internal\", \"back\", \"rendersurface\"];\n```","code":["_cam cameraEffect [\"internal\", \"back\", \"rendersurface\"];"]},{"text":"```sqf\ncam = \"seagull\" camCreate (player modelToWorld [0,0,100]);\ncam cameraEffect [\"FIXED\", \"LEFT TOP\"];\ncam camCommand \"MANUAL ON\";\n```","code":["cam = \"seagull\" camCreate (player modelToWorld [0,0,100]);\ncam cameraEffect [\"FIXED\", \"LEFT TOP\"];\ncam camCommand \"MANUAL ON\";"]},{"text":"```sqf\n_ctrl = findDisplay 46 createDisplay \"RscDisplayEmpty\" ctrlCreate [\"RscPicture\", -1];\n_ctrl ctrlSetPosition [0.5, 0, 0.5, 0.5];\n_ctrl ctrlSetText \"#(argb,512,512,1)r2t(rtt1,1.0)\";\n_ctrl ctrlCommit 0;\n_cam1 = \"camera\" camCreate (ASLToAGL eyePos player vectorAdd [0, -10, 0]);\n_cam1 cameraEffect [\"Internal\", \"Back\", \"rtt1\"];\n_cam2 = \"Land_HandyCam_F\" createVehicle [0,0,0];\n_cam2 enableSimulation false;\n_cam2 setPos (ASLToAGL eyePos player vectorAdd [0, 10, 0]);\n_cam2 setDir (_cam2 getDir player);\nswitchCamera _cam2;\n```","code":["_ctrl = findDisplay 46 createDisplay \"RscDisplayEmpty\" ctrlCreate [\"RscPicture\", -1];\n_ctrl ctrlSetPosition [0.5, 0, 0.5, 0.5];\n_ctrl ctrlSetText \"#(argb,512,512,1)r2t(rtt1,1.0)\";\n_ctrl ctrlCommit 0;\n_cam1 = \"camera\" camCreate (ASLToAGL eyePos player vectorAdd [0, -10, 0]);\n_cam1 cameraEffect [\"Internal\", \"Back\", \"rtt1\"];\n_cam2 = \"Land_HandyCam_F\" createVehicle [0,0,0];\n_cam2 enableSimulation false;\n_cam2 setPos (ASLToAGL eyePos player vectorAdd [0, 10, 0]);\n_cam2 setDir (_cam2 getDir player);\nswitchCamera _cam2;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["switchCamera","cameraView","cameraOn","setPiPEffect","camCreate","cameraEffectEnableHUD","camUseNVG","setCamUseTI"],"notes":[{"user":"Killzone_Kid","date":"2016-10-30T16:40:00Z","text":"Types of camera for CfgCameraEffects config:\n- CamExternal (CamInterpolated)  // linked directly with object\n- CamStatic  // fixed point in space\n- CamStaticWithZoom  // fixed point in space\n- CamChained  // chained\n- CamTerminate  // terminate\n- CamInternal  // internal view"}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Camera Control","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}