let's approach this systematically:
1) we need a way to detect whenever the character reaches the edge of the view
and
2) we need to change the cameras x position to fit.
So how could we see if the character reaches the end of the screen? There're a couple of ways, but the easiest in a 2D game would just be a float called "max delta position". We don't need a min for now.
So what you do to get this float is move your character from the centre of the view to the edge of the view. Note the X position (if X is left/right) in world space (just unparent the character). Then undo it and note the normal X position. Subtract your first note from your second, and you'll have the total amount of space between the center of the screen and the side of it.
Now, make sure the camera is separate from the character. THen let's start the FSM on the camera:
First we want to get the x position of the character and the x position of the camera, both in world space. Then we'll use the camera position and make it max the "camera position" to "character position - max delta position" (remember, the one in the previous paragraph). Now, if the camera position is less than character position - max delta position, then it'll be made to that value. If we now assign the new camera X position in a set position action to the camera, it'll always move with the player once he reaches the right side of the screen.
The same needs to be done for the other side of the screen, and you do it by using min in the float operator and by using "character position + max delta position" as the min Value. Now of course these + and - terms need separate float operators.
Now, if you do all this each frame, your camera will follow the character as soon as he reaches the edge of the screen.
I hope it helped, and do note that I did this all in my head, so some details may be mangled, but the general principle should work
Cheer,
kiriri