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

5 comments
in that case when they move set their cframe to CFrame.new(pos.X, pos.Y, 0)
pos being their position defined when they move
Wouldn't that be a lot for the game to run with everyone moving around? Also, I don't think it would work when a player is being flung with no keydown inputs
Not to say there aren't alternatives but wouldn't the invisible wall really be the best solution? I mean your entire map can be covered with 2 walls alone
That's what I'm thinking, it's what I have now, was just curious as to whether or not there was a better suggestion out there... maybe I'll find out eventually!