Hello,
I use this code in the end-step event of my Hero object to move the camera on my top-down game:
but i dont find how block it if the camera is outside the room, the camera continues to scroll the view out of room... can you help me?
Thanks!!
I use this code in the end-step event of my Hero object to move the camera on my top-down game:
Code:
var targX = x-camera_get_view_width(view_camera[0])/2;
var targY = y-camera_get_view_height(view_camera[0])/2;
camera_set_view_pos(view_camera[0], lerp(camera_get_view_x(view_camera[0]), targX, 0.1), lerp(camera_get_view_y(view_camera[0]), targY, 0.1));
Thanks!!