Make it so it is absolutely impossible for a player to move on the Z axis

So I’ve checked devforum but I couldn’t find anything like what I am looking for. Basically, I’m making a 2d platformer and I want to make it absolutely impossible to move on the Z axis. I’ve disabled moving forward and backwards with controls & I tried putting invisible borders around the player, but that’s buggy and not smooth because a player can just run into a wall and move a bit. Is it possible to achieve what I’m looking for?

This may be helpful: Disabling player movement on the Z axis - #4 by Brickman808
Also you can check the code for the template called line runner.
Another thing you could do would be to set the player’s z value to 0 every time their position changes.

1 Like