Make player turn 90 degrees right, smoothly, when a button is pressed,

D key - turn right 90 degrees, smoothly
A key - turn left (-90 degrees), smoothly

I’ve tried multiple ways to do this such as using integers, timeline, rinterpt etc.

This is just one of the ones I tried that I just don’t know why it doesn’t work but it doesn’t have to look like this.

Hello,

I’m a bit of a noob still so idk if this answers your question. But if I’m not mistaken, all you need to do is change your “Set Actor Rotation” function to a “Set Actor Relative Rotation” function. Then it should work smoothly. Set Actor Rotation changes coordinates instantly, Relative does it over DeltaTime (if I’m not mistaken.)

Here’s some helpful docs related to it too.
Opening Doors | Unreal Engine Documentation

SetActorRelativeRotation | Unreal Engine Documentation

Hoping this is what you were looking for.

1 Like

Another solution could be to turn the character directly and play some animation before / after the turn to let it look realistic.

If you can find it on this forum there’s an answer of mine to do exactly this in a 2.3D style setting (side scroller template) from somewhere around 2019… I think.

In reality with the forum move and all, they probably lost all that content…

Search for it, if you can’t find it I’ll share the BP screencaps I should probably have saved up somewhere.

ps: you can’t turn the animation, you have to turn the character actor.
Otherwise your input gets inverted.

I would be scrolling forever trying to get to 2019 xd.
It all goes right until the rInterp happens, where that return value does not go into the set actor rotation.

For some odd reason this works, and 6.9 delta time makes it turn just about 90 degrees.
I would rather understand why it works not that it just does. It is a bunch of specific things that I must know- such as why is getactorrotation not rechecking the rotation when it is fired again by the timeline? Anyways

If you use a timeline there’s no need for an rinterp.
Just add a rotation value in the timeline that output the Z you want over time.
Then Add rotators…