How to create horizontal bound for 2d maps?

I’m making a game like Super Mario Run now, and would like to prevent the character to run through the left and right boundary without having to put a “wall” to block it.

The idea that flashed through is to set x axis speed to 0 when pawn reach the circumscribed boundary (so if u try to walk through, u’ll just stay at the point; try to jump over will leave u falling down with only the Z velocity caused by gravity)

Any way to implement it in blueprint? Sorry I’m still not familiar with game making, and thanks in advance for any assists!

Create an invisible mesh which has a collision.