Page tree
Skip to end of metadata
Go to start of metadata

Introduced in




Sets a basic, fixed, unobstructed camera of a given target (in a cutscene). It is useful when you do not know the exact position or nature of the targets in advance, but want to be sure they can clearly be seen during the cutscene.

The function tries a number of camera positions, attempting to find a position where the camera view of the target is not obstructed.

Two targets can be passed, in which case, the function attempts to work both targets into the shot, although the first target is given priority.

The function has a number of camera angles to choose from, depending on the number and nature of targets passed.

The function takes the size of the targets into account when deciding on camera placement. A distance modifier is passed, which modifies the default distances chosen by the function:

  • A value of 1 means the default distances are chosen.
  • A value of 2 means the distances are roughly twice as far for those given targets.

After the function is called, the camCommit command must be executed, using the camera, in order to commit the changes.

Note: If the function fails to find a suitable camera, false is returned. The camera can still be committed, but the primary shot target cannot be seen.


Syntax:[camera, distance_modifier, primary_target, secondary_target] call fn_vbs_camSetFixedShot
  • camera: Object - Camera to set up for the shot.
  • distance_modifier: Number - Modifies the camera distance used by the function by default (defaults already take the size of the target(s) into consideration):
    • A value of 1 means use defaults.
    • A value of 2 means use roughly double the defaults, and so on.
  • primary_target: Object or Position3D - Primary target of camera shot, centered in the frame.
  • secondary_target (optional): Object or Position3D - Secondary target of camera shot, which the function also tries to incorporate into the shot.
Return Value:Boolean - Returns true, if the shot has a clear view of the target(s); false, if not (although the shot is still ready to be committed).


When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.


// Create the camera
_camera = "camera" camCreate [0,0,0];
_camera cameraEffect ["INTERNAL", "BACK"];

// Set up initial shot, only one target
_clear = [_camera, 1, player] call fn_vbs_camSetFixedShot;
_camera camCommit 0;

// Hold the shot
sleep 5;

// Find a new shot with two targets
_clear = [_camera, 2, getpos _tank, player] call fn_vbs_camSetFixedShot;

// Apply new shot only if target is visible
if (_clear) then {_camera camCommit 2};

// Hold current shot
sleep 5;

// Destroy the camera
_camera cameraEffect ["TERMINATE", "BACK"];
camdestroy _camera;

Additional Information

See also: fn vbs orbitCamera