I'm trying to make a small 2D fighting game where characters can only move along the X or Y axis, which is easy enough for me to code, but the game also involves knocking/flinging players around the map, which can easily send them into the background/foreground out of the control of the player.
I was wondering if this could somehow be prevented, so all players are forced to stay at Z = 0, for example. The closest thing I can think of is simply invisible walls, but I was wondering if there is a more effective alternative out there?
Thanks, Elliott