Hi there,
If I understood correctly, you might want to limit the combat arena and have its boundaries aligned to your camera, assuming you’re using a fixed camera angle. Overlap spheres or boxes can be coded to check actors’ location. Then, I see a few options:
- On Enemy targeting the player, before launching the dash attack, check if player’s location is a bit far from the edges (perhaps around 2 m). If so, do the dash attack with reduced/clamped hit impulse. Else, change the attack type for something more convenient.
- On dashing towards the player closer to the edges, reduce the hit impulse or just play a death montage with a notify to go ragdoll when the player is almost hitting the ground. That would prevent the player from flying outside the arena.
- If player goes flying, the overlap spheres will detect enemies going outside boundaries and change their behavior accordingly.
I really hope these options give you some insights.