How to rotate character fully with orient rotation to movement

Hey all,
I want to have the character rotate fully to the direction from the input (w,a,s,d) but unless I hold the key down it only rotates a bit, how do I make the character rotate fully with just 1 press? I know you can increase the rotation rate in the character movement but I dont want it to be instant

This is how I want it to be: https://www.youtube.com/watch?v=gUhka_gSAdw

This is how it is for me now: https://www.youtube.com/watch?v=9b42X0zPUKA

Thanks in advance :slight_smile:

Hi @Faze_Kaas, there are some solutions to this.

  1. Changing Rotation Speed
    In the Character Movement Component, there is a settings called Rotation Rate. By changing these settings, it would allow your character to rotate towards your input direction quickly. This might cause snapping which may not be something you want.
  2. Coding A Custom System
    Lies of P is using UE as well and knowing that there isn’t an option to allow this type of rotation, it’s very likely the developers coded a custom function to handle character rotation. This is quite simple to make, but when and how you use this function is entirely up to you.

HOW TO MAKE:
To make this system you need get your CharacterMovementComponent and find a function called GetLastInputVector then you need to get Rotation From X Vector using the GetLastInputVector. This rotator is the direction of your input. You can create a Timeline or something to update your character’s current rotation by SetActorRotation. The new rotation will be the return value from Rotation From X Vector Use Lerp or RInterpTo to get smooth rotation.

Hope this helps! :+1:

“orient rotation to movement” isn’t really compatible with “I want to control the orientation of the character.”

I think you’re better off implementing this behavior yourself, and read the controller yaw yourself, than using that flag, if you want special behavior.

You can do this by either subclassing UCharacterMovementComponent or by jamming it into Tick on the Character subclass itself.

Hi @ArcReed3215 @jwatte thanks for your answers,
I ended up going with caching the input until the character was rotated, which works great :slight_smile:

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