{"name":"cameraEffect","title":"cameraEffect","type":"command","url":"https://community.bistudio.com/wiki/cameraEffect","revid":336915,"updated":"2023-01-04T16:43:59Z","groups":["Camera Control"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"local"},"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]","params":[{"name":"camera","type":"Object","description":"object of type \"camera\"","type_expr":"Object"},{"name":"effectName","type":"String","description":"the effect type (defined in main config or CfgCameraEffects >> Array). Defaults are: `\"Internal\"`, `\"External\"`, `\"Fixed\"`, `\"FixedWithZoom\"`, `\"Terminate\"`","type_expr":"String"},{"name":"effectPosition","type":"String","description":"position of the effect. Can be one of:\n\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\"`\n\nThese are usually used with \"Fixed\" and \"FixedWithZoom\" effect types. If not sure which position to use, set it to `\"BACK\"`.","type_expr":"String"},{"name":"r2tName","type":"String","optional":true,"description":"Render To Texture surface reference","type_expr":"String","text":"r2tName: String - (Optional) Render To Texture surface reference"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"camera"},"right":{"text":"[effectName, effectPosition, r2tName]"}}],"examples":[{"code":["_cam cameraEffect [\"internal\", \"BACK\"];"]},{"code":["_cam cameraEffect [\"internal\", \"back\", \"rendersurface\"];"]},{"code":["cam = \"seagull\" camCreate (player modelToWorld [0,0,100]);\ncam cameraEffect [\"FIXED\", \"LEFT TOP\"];\ncam camCommand \"MANUAL ON\";"]},{"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;"]}],"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\n- CamExternal (CamInterpolated) `type = 0;` // linked directly with object\n- CamStatic `type = 1;` // fixed point in space\n- CamStaticWithZoom `type = 2;` // fixed point in space\n- CamChained `type = 3;` // chained\n- CamTerminate `type = 4;` // terminate\n- CamInternal `type = 5;` // internal view"}]}