So in GMS2, what you can do is create an object, you can call it obj_view or whatever you want, and you place it in the room. Then in the room editor, in the properties tab under 'viewports and cameras', enable viewports. Then simply choose a viewport, they are labelled 0-7, set it as visible, and then choose obj_view for 'object following'.
Then all you need to do is program obj_view to move the way you want it to and the view will follow it. If you wanted it to move to the left or right of the screen based on where you clicked you could do something like this in the mouse click event:
Code:
if(x < mouse_x) x = //wherever the right side of yours screen is
else x = //wherever the left side of your screen is
And for a very ugly and basic mouse following code, you could place this in the step event:
Code:
x += sign(mouse_x - x);
y += sign(mouse_y - y);
You can tweak that a little bit to make it less ugly as well as faster and more responsive if you want. Like I said very ugly.