Limit the available stage space?

I know the title does me no justice, but I’m working on making a side scrolling space shooter game (sure everyone knows the kind). And I was wondering whats the best way to go about locking the ships movement to a set rectangle that’s the same as the viewport, how would you guys do this?

Or You Simply make some Cubes around your scene and make them not visible with colliders. :wink: