{"name":"camCommit","title":"camCommit","type":"command","url":"https://community.bistudio.com/wiki/camCommit","revid":325309,"updated":"2022-07-10T23:02:07Z","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":"Smoothly conduct the changes that were assigned to a camera within the given time. If the time is set to zero, the changes are done immediately. For `camPrepareXXX` commands use camCommitPrepared.","syntaxes":[{"syntax":"camera camCommit time","params":[{"name":"camera","type":"Object","description":"object of type \"camera\"","type_expr":"Object"},{"name":"time","type":"Number","description":"time in seconds during which the changes shall be done","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"camera"},"right":{"text":"time"}}],"examples":[{"text":"SQS Syntax:\n\n```sqs\n; create a camera object\n_cam = \"camera\" camCreate [5600,4800,10]\n_cam camSetTarget player\n_cam cameraEffect [\"internal\", \"BACK\"]\n_cam camCommit 0\n\n; smoothly move the camera to its new position in 6 seconds\n_cam camSetPos [5680,4720,20]\n_cam camCommit 6\n@camCommitted _cam\n\n; proceed\n```","code":["; create a camera object\n_cam = \"camera\" camCreate [5600,4800,10]\n_cam camSetTarget player\n_cam cameraEffect [\"internal\", \"BACK\"]\n_cam camCommit 0\n\n; smoothly move the camera to its new position in 6 seconds\n_cam camSetPos [5680,4720,20]\n_cam camCommit 6\n@camCommitted _cam\n\n; proceed"]},{"text":"SQF Syntax:\n\n```sqf\nprivate \"_cam\";\n\n// create a camera object\n_cam = \"camera\" camCreate [position player select 0, position player select 1, 2];\n_cam camSetTarget player;\n_cam cameraEffect [\"internal\", \"BACK\"];\n_cam camCommit 0;\n\n// smoothly move the camera to its new position in 6 seconds\n_cam camSetPos [position player select 0, (position player select 1) + 10, 20];\n_cam camCommit 6;\nwaitUntil { camCommitted _cam; };\n```","code":["private \"_cam\";\n\n// create a camera object\n_cam = \"camera\" camCreate [position player select 0, position player select 1, 2];\n_cam camSetTarget player;\n_cam cameraEffect [\"internal\", \"BACK\"];\n_cam camCommit 0;\n\n// smoothly move the camera to its new position in 6 seconds\n_cam camSetPos [position player select 0, (position player select 1) + 10, 20];\n_cam camCommit 6;\nwaitUntil { camCommitted _cam; };"]}],"see_also":["camCommitted","camCommitPrepared"]}