Prevent Player from facing camera in the Side Scroller template?

How can I prevent the character from facing the camera or facing away from the camera when switching directions?
A very little switch in directions always results in the character facing the camera.
Like this

I want the character to always face either left or right based on the last directional input the player made. I was looking for a turn speed input.

I’m sure it’s a pretty easy thing to fix, but I couldn’t find an answer.

Hey, I think you can solve this problem by going to the defaults tab on your blueprint and setting “use controller rotation yaw” to true and “orient rotation to movement” to false.

Thanks but it didn’t work, at least not using a keyboard, I haven’t tried using a 360 controller. Using a keyboard the character always faces in the same direction, and moonwalks instead of turning. I found a hacky solution that works by changing the rotation rate Yaw from 720 to something very high like 4320.

Ok, give me a few minutes, I’ll try it on my end.

Here is how I got it to work: create a new variable and call it DirectionPrev, set its default value to -90.

Wire your blueprint as shown in the screenshot (it’s pretty self-explanatory, but let me know if you need any explanations):

Just tried it, it works like a charm, Thanks a lot!

Glad to help! Good luck with the rest of your project.

Hey there, would you mind upvoting the answer so the question shows as resolved? Cheers.

I thought I did, but apparently it didn’t register. Sorry about that!

This was a big help. Thanks you two!