How to make camera follow x or y?

Currently I have a camera that stops following the player when the player passes a certain point. However this means that once one boundry is passed, it no longer moves at all. For example, if I reach the top screen boundry, it won’t follow the player left or right until I exit the top boundry first. Is there a way to make the camera stop following on specifically x or y but keep the other.

camera.script
code

u can check whether the camera reached a limit barrier. If it goes beyond that barrier just dont move it, but if it doesnt just make it move normally. U dont need to unparent it, just check each axis individually if it should move or not. Like, check if the camera position is beyond the top of the screen, something as simple as “if go.get_position(’#camera’).y < top_bound then move_camera() end”. Comment if u need more help, glad to help!