Player able to go "off-track" in 2D game

Hello, I’m trying to make a 2D fighting game and it’s actually going great. There is one minor problem though, I’m not sure how many problems this will cause but I wanna fix it as early as I can.
Here is how the bug can occur:

And here is the effect:
Untitled
You can see it is quite drastic.

I have 2 invisible walls that definitely helped reduce the issue but its still pretty bad.
If anybody can suggest a solution I would greatly appreciate!

So, to fix the issue, I would suggest doing

Torso.CFrame = CFrame.lookAt(Torso.Position * Vector3.new(0, 1, 1), Torso.Position + Torso.CFrame.LookVector, Torso.CFrame.UpVector)

Bind to RenderStep.