I’m making a Star Fox-like game with flying combat and I have invisible walls to stop the player from exiting camera view, but having the ship stop in place immediately when hitting the walls feels a bit jarring (and comes with a weird glitch where the player gets stuck after contact sometimes), im looking to add invisible barriers that work more like rubber bands (when you push against them you dont stop instantly, it slows you down first, then pushes you back when you let go) This is a hard concept for me to explain through text
Is there a feature in UE5 that will let me do something like this? Thanks.
I don’t think there’s anything pre-built in UE for that.
The way I’d do that is to have two tiers of “walls”, the first, closest to the player, would not actually block, but instead just trigger a state where the player’s velocity is automatically shifted towards the center when they go through it. The second is still a hard wall, just in case the push is not enough.
You could also do it by calculating the distance from your desired center point, and if it’s beyond a certain threshold, you again start applying velocity to that center point, maybe multiplied by the distance (probably do it separately for horizontal distance vs. vertical distance or the player will be constrained to just a circle)
You can fake an “invisible wall” using high friction instead of blocking collision.
Create a Physics Material with very high friction, assign it to a thin collision volume (like a box), and set collision to overlap or minimal blocking. When the player enters it, their movement slows down drastically, giving the feeling of an invisible barrier without a hard stop.
For better control, you can also reduce the character’s movement speed on overlap.
Hey @Mastatatoe Did you ever get a good solution worked out? Let us know! This is an interesting one to follow and it’d be really cool to see what you work out!
Instead of relying on blocking collision, use a Trigger Volume (Box/Sphere Overlap) and handle the behavior manually:
1. Detect entry into boundary
Place a larger invisible volume where the “soft wall” starts.
Use OnComponentBeginOverlap to detect when the player enters it.
2. Gradually reduce player control
As the player gets closer to the edge, scale down their input or velocity.
For example:
Map distance → speed multiplier (1 → 0)
This creates that “pushing against resistance” feel This is a known technique: mapping distance to movement limits instead of stopping instantly (Epic Developer Community Forums)
3. Apply opposite force (rubber band)
When inside the volume, apply a force or movement offset back toward the center:
Direction = (center − player position)
Strength increases the deeper they go
4. Release behavior
When player stops pushing, the force naturally pulls them back → gives that elastic feel
Alternative (simpler Blueprint logic)
A very common pattern suggested by UE devs:
First phase: slow player to a stop (~1 second)
Second phase: apply increasing force pushing them back