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

I got it to work like this.

I seriously don’t know how to thank you. I appreciate you being patient with me being as a beginner.