This function can be used to retrieve the unique camera ID value of the currently active camera.
Camera index (real).
var active = camera_get_active();
if active != view_camera
view_camera = active;
The above code gets the camera ID for the active camera and sets the view camera for port to use it.