| 123456789101112131415 |
- if instance_exists(follow)
- {
- x_to = follow.x;
- y_to = follow.y;
- }
- x += (x_to - x) * smooth;
- y += (y_to - y) * smooth;
- x = clamp(x, cam_width/2, room_width - cam_width/2);
- y = clamp(y, cam_height/2, room_height - cam_height/2);
- var _cam_x = x - cam_width/2;
- var _cam_y = y - cam_height/2;
- camera_set_view_pos(view_camera[0], _cam_x, _cam_y);
|