With this function you can tell GameMaker Studio 2 to activate all instances that have been previously deactivated in a room. Note that activation is not instantaneous, and an instance that has been activated in this way will not be considered to be active until the end of the event in which the function was called.
var _vx = camera_get_view_x(view_camera);
var _vy = camera_get_view_y(view_camera);
var _vw = camera_get_view_width(view_camera);
var _vh = camera_get_view_height(view_camera);
instance_deactivate_region(_vx - 64, _vy - 64, _vw + 128, _vh + 128, false, false);
The above code activates all instances within the room and then deactivates those that are 64px outside of the limits of the current camera view.