# Turning character to face input direction

I’ve been trying to recreate the rotation behaviour in this video with my character but can’t quite seem to get it working right. In the video, I’m tapping directions on the control stick and keyboard to make the character turn toward that cardinal direction, and obviously if I hold down a direction that’ll just transition into movement. It seems to be a pretty common feature in third-person games I’ve played that don’t lock player rotation to the camera.

My character is using Orient Rotation To Movement, but if I simply adjust the rotation rate it’ll either be too fast or too slow, not really what I’m looking for, and it wouldn’t snap to a cardinal direction like that either.

I’m probably dumb and simply not thinking about an obvious solution here, but I would appreciate any advice/pointing in the right direction!

I think it all comes down to camera movement , not character movement. Character movement is constant but just based on camera direction. You want to interpolate the camera movement, which clearly does not want to move freely when the player is staying at the same location (even when rotating). But when the player starts moving the camera initiates and starts following the character. I would probably try to approach this with linear interpolation and timelines that change interpolation value of the camera movement, or a simple boolean with initiates camara movement upon a given amount of character movement… It’s an interesting problem to solve.

BTW, I would also make sure the camera is not somehow connected/attached to your player character, it should be a separate Actor.

Thank you for the reply! I like the idea of the camera being a separate actor for sure! You are talking about having the camera follow the character movement?

I think I was unclear when I asked my question though, I’m sorry if I’m bad at explaining! I don’t actually want my camera to follow the player in this instance, I just want the character to turn to face the direction I’m specifying. Here’s another video from my Unreal scene currently, I’m facing forward, so when I press the S key I should turn around to face the camera. If I hold down S my character moves toward camera as intended, but if I just tap the button, my character doesn’t rotate fast enough to face camera. I don’t want to adjust the rotation rate in my Character Movement Component, as that will make the character turn unnaturally fast, but rather I want the character to register my intended direction (in this case, backward) and smoothly rotate my Character capsule to face backwards. (and I would trigger some sort of turn around animation of course)

I’m unsure how I would go about setting up a system like that

Did you ever solve this issue? I’m curious about it myself!

I have unfortunately since moved on to other projects without solving this particular issue

My best guess here would be to turn the player capsule at a very fast rate (or even set it to 0 to turn it instantly!), and have the skeletal mesh lag behind, constantly interpolating to catch up and face forward again, and use a turn in place animation during the interpolation.

Digging through some old links I had saved, I did find this that was somewhat related and has some useful information, it’s a blog from Epic about converting Lyra’s systems to use Orient Rotation To Movement: