/// @param target

var _target = argument[0];

var _cam_x = camera_get_view_x(global.camera);
var _cam_y = camera_get_view_y(global.camera);

var _x = lerp(_cam_x, (_target.x + _target.aim[vec2_x]) - WIN_WIDTH / 2, 0.25);
var _y = lerp(_cam_y, (_target.y + _target.aim[vec2_y]) - WIN_HEIGHT / 2, 0.25);
var _max_x = room_width - WIN_WIDTH;
var _max_y = room_height - WIN_HEIGHT;

global.camera_x = clamp(_x, 0, _max_x);
global.camera_y = clamp(_y, 0, _max_y);
camera_set_view_pos(global.camera, global.camera_x, global.camera_y);