camera_get_default

This function can be used to retrieve the unique camera ID value of the default camera (the camera that GameMaker Studio 2 uses when no camera views or ports are active in a game room).

 

Syntax:

camera_get_default()

 

Returns:

Camera index (real).

 

Example:

var def = camera_get_default();
view_camera[0] = def;

The above code gets the camera ID for the default camera and sets the view camera for port[0] to use it.