How to control which way my character turns

Hello guys!
I have this issue where the character turns from the opposite side of the camera.

I want him to turn from the side of the camera. Ive tried things with get control rotation, right vector and other stuff but I cant seem to understand how to make that happen
Here is the code of the movement:

Thanks!

Are you using Orient Rotation to Movement within a character class? If so, you want to add a slight bias to the movement direction so that the character moves slightly in the direction you want to turn.

This may not be ideal for a side-scroller though, as after playing for a while your character may fall off the map due to the slight movement towards the camera. Ideally, you want to make your own function to rotate the character, rather than relying on Unreal’s (abysmal) Orient Rotation to Movement.

Thank you so much for the response


Yes, I am. Should I disable it and make my own function? Havent done that ever. Do you have any pointers on where to start and how should I approach this?

1 Like

I m thinking a Lerp Rotator that gets changed based on the IA_Move value. Would that work or cause any issues?

1 Like

After movement input do this. You can add a branch before doing it all to prevent the rotation when your character is climbing.

Here’s what that looks like for me. The animations are a bit misleading but the floating arrow points in the actor’s direction. The direction is printed to the screen in the top left as well, this Print String and its Select node can be removed.

Keep in mind you may need to play with the values depending on which direction the camera and input actually consider to be right and left. In my example an Actor Rotation of (x0, y0, z0) is considered right, which is the direction I’m facing in the beginning of the video and left is (x0, y0, z180). Let me know if you need more explanation.

Thank you so much this is the awnser after you first response I did something similar to what you did but you pretty much gave me the idea

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.