How can I snap my box collisions to the edge of the screen?

Earo60
Wed, 11 Jun 2025 13:16:15 +0000
Blueprint

To cut to the chase, I want to make my box collisions to snap to edge of the mobile screen (left, right & top) so when the ball goes on one of the edges it will bounce perfectly. Setting it manually isn’t good enough due to the different mobile screen sizes. On a smaller screen the manual method can either be good (works perfectly) or bad (bounces off screen). While on bigger screens the collisions will be visible.

There are 3 different wall Actors that consists of a Box collision (this will be used) and a cube (for reference it will get removed later)

Left Wall

Right Wall

Top Wall

Here is the result of the above blueprints.

Even though it seems to be working I’m still wondering if what I did is correct. Cause testing it i found out that the ball bounces off screen of the left wall while the right wall is slightly inwards.

So I’m asking is there a way to optimize this blueprint logic. I just started experimenting with deproject and still learning but I cant figure it out.

1 post - 1 participant