One press no matter how long and character will make complete turn to that direction?

I noticed that in many AAA games that the character will make a full turn to the input direction no matter how long you press the input key.

By default unreal seems to only rotate to the rotation of input over time while the input is pressed, but stops rotating immediately once input is released. Is there certain options or method to go about properly making it so it will still gradually rotate, but does a full turn to that direction despite say, just tapping the input key in the direction briefly? Not 100% sure if I want this, but wanted to try it and see how it feels. =/

Hey @Gore23!

To do this you’ll simply adjust your rotation rate Z variable on the Character Movement component!

image

image

Turn up that value or set it to 0 for instant turning! :slight_smile:
Let us know if there’s more we can assist with!

Ty, but not quite. instant turn is nice, but I am pretty sure that the AAA games character is usually a smooth rotation like usual, except that they make the full turn to input direction despite if you are still holding down or not. I crossed a tutorial on the method that had done it on youtube, thought I saved it but I cannot find it again. T.T

Depends on your animation methods. I’d have one property on my character store a target rotation (FRotator). Target rotation value updates immediately into a direction when a key is pressed. On Tick you can read both the current rotation from your mesh and the target rotation and interpolate to the target. In your animation blueprint you could make it more complex, like first turning the head and upper body, then feet etc…

Oh boy, I see. Will be a bit heavier of a thing to try out than I thought then. Will have to wait till a little further along I suppose. Still wrapping my head around animating with a animation tree and all the stuff in that. TRYING to figure out the methods of ALS’s code. xD goodness. Thank you for the help.

1 Like

ALS is really good. I finished a c++ version before I figured out (or before it existed) that there is also an official one on github lol. It’s exactly what I refer to.

One way to do this is to fake player input after an initial input until the character has reached the desired rotation if the player release the stick.
So you stored the last direction input, and if it becomes zero, you keep using it until you’ve reached the proper direction.
Bear in mind that this introduce some lag when releasing the input, obviously. But that goes with the design I guess.

For side scrollers and beat em ups I want it to be old school and instantly turn left or right when pressed.

Here is how I do it.

The Null Instaturn boolean is there for like Beat Em Up games there are times you want to null it like when knocked down for example.

Works good for the NPCs in said examples too.

I wonder if something similar to this for an 8 direction approach for overhead and the character could “snap” into place into one of 8 directions based on direction pressed? Like for an overhead run and gun shooter game.

1 Like

Another way game approach this is that the capsule actually snap to the target rotation, but the anim instance will rotate the skeletal mesh and possibly handle things nicely with turn in place animation and some IKs to prevent foot sliding.

1 Like

TYVM everyone. Not sure what I will go with, but a ton of potential options I will have to try. Ty ty