Limit horizontal movement of player in what camera see

Hi i am trying to make a game like doodle jump but i cant get the player to move only in what the camera sees in the horizontal.I want the player to move from the one side to the other and not out of what my camera see.

Any help would be great.

Also if you know how to make the player to teleport when i goes to the one side and to come from the other

In a setup like this you can just calculate your boundaries in world space and then whenever you update your character’s position you check where he will be after that update and if he is out-of-bounds then you can either stop him (aborting the update) or set his new location (on the opposite side of the screen) by hand, because you know his current location and you know the screen bounds so it’s really easy to calculate everything you need.

Thank you for your anwer i will try this right away.Sorry for the noob question but how can i make the object he jump on being generated automatocly so that i can make the game be endless

Could you give an example in blueprint if it is possible

Sure, though I don’t have access to engine right now, but I will post a picture of such setup when I have it.

Thank you thar would be great :slight_smile: