How to make input axis lerp smoothly?

Hi all UE4 Citizens. Its my first ever question, for the first thing that I tried to do for myself.

I was following along the official basic tutorial of Unreal Engine
[you tube link][1]

And basically we has a blend state and we made a third person controller run around. However I noticed that the blend state for the locomotion had no effect because the Input axis we set up in project settings were always either -1, 0, or 1. So in essence we were always moving at top speed, or no speed. which made the blend state useless.

Maybe there are better approaches to fix this. However I want to have my Input Axis Lerp through range of [-1, 1]
or something like that. I did not find that property. So I decided to Blueprint it.

Placing aside the fact that I am not the most organized blueprinter. It sort of works. But I feel it shouldn’t be this
Complicated.

Is there a property to make the Input Axis smoothly lerp from [-1, 1]. So that the blend state of idle_walk_run can actually transition?

The node you are looking for is “finterp”. (There are a couple of “interp” nodes. f for float, v for vector and so on).

The “finterp” node takes three inputs: Current, Target and Speed. This would get rid of all those clamp and what not nodes :wink:

You can just adjust the acceleration in the defaults of your character.

You can just adjust the acceleration in the defaults of your character.

finterp would improve the smoothness. I did not think to look for interpolate. now i know.

Ok now I understand. The movement controller recieves between [-1, 1] inputs, and properly accelerates. For some reason the default “Max Acceleration” on my movement controller was set to 2048.0 which is 20 m/s which is double gravity, which is alot.

Using this video:

I added this bit of BP (Grey block on left) to the character to smooth the keyboard input. Note that “Delta” is the Tick Event Delta Seconds promoted to a variable.

4 Likes