How to make the character move only left and right when it enters trigger box

excuse me im fairly new to the engine so it might seem like I have no idea what I am doing.