hi sir pls make new object put this code in events and then put in room thx
////////////////Create Event:
smoothness_factor=6;
view_object=object_index;
view_vspeed=-1;
view_vborder=view_hview/2;
view_hborder=view_wview/2;
//////////////////////Step Event:
if (instance_exists(player)) {
target_x=player.x;
target_y=player.y;
dist=point_distance(x,y,target_x,target_y);
if (dist>64) {
x=player.x;
y=player.y;
speed=0;
exit;
}
}
speed=dist/smoothness_factor;
direction=point_direction(x,y,target_x,target_y);
if (speed<1) speed=0;
////////////////////////////Room Start:
//copy of step event, to prevent flashing on room start
if (instance_exists(player)) {
target_x=player.x;
target_y=player.y;
dist=point_distance(x,y,target_x,target_y);
if (dist>64) {
x=player.x;
y=player.y;
speed=0;
exit;
}
}
speed=dist/smoothness_factor;
direction=point_direction(x,y,target_x,target_y);
if (speed<1) speed=0;