Step:
if (instance_exists(follow))
{
xTo = follow.x;
yTo = follow.y;
}
x += (xTo - x) / 25;
y += (yTo - y) / 25;
x = clamp(x,view_w_half,room_width-view_w_half);
y = clamp(y,view_h_half,room_height-view_h_half);
camera_set_view_pos(cam,x-view_w_half,y-view_h_half);
Create:
cam = view_camera[0];
follow = Chub;
view_w_half = camera_get_view_width(cam) * 0.5;
view_h_half = camera_get_view_width(cam) * 0.5;
xTo = xstart;
yTo = ystart;
Chub is the player BTW The camera wont follow the player
0 comments