How can I make my player move in and out

Hey guys. I am currently trying to develop a simple side scrolling game in unreal. For the most part I have had no problems but I would like to make the character be able to move to back and front, somewhat similar to the gameplay of Little Big Planet. I have looked around in character physics and such but I’m not sure what is constraining the character to a certain X location. To try to get the character to move to the back and front I basically just copy pasted the left right movement and changed the movement to x -1 instead of y -1, I also created a new Axis Mappings component called MoveBack and used that instead of MoveRight.

I would likely do this with an enumeration for the layers. If we are talking Little Big Planet 3 styled and you wanted something like 16 layers then you would add 16 inputs to the enumeration and name these 1-16, If you wanted the original style with just three you could have front, middle, back in the enum and then you have your player add a movement input by a certain axis depending on which way your world is facing. You would then have it so that you can’t move backwards if the enum = back and can’t move forward if the enum = front. For the movement input you could just add an axis mapping for moving back and forward. Sorry if this is a bad answer, I’ve really never answered anyone’s questions on the forum but your question wasn’t getting answered so I stepped in. If you have anything else you want to ask if I know it I will try to answer.