Limit pawn location to camera view

Hey I’d like my default pawn (the player’s pawn) to be able to move freely within the camera view, but it’s not allowed to go further.

Basically, the camera should be moving automatically to the right every tick (Sidescroller game) and the pawn should stay in the camera view.

Solved by creating a camera in the level blue print and use it as main camera.