Using EnhancedInputActions I can assign a ‘Smooth’ modifier that might do what I want. But I don’t know. I can’t find any documentation of this anywhere and the tooltip when hovering over the modifier simply says “Smooths Input out over multiple frames.” How many frames? How do I change this? I put this on an Axis1D input and it didn’t seem to have ant effect?
Where is the documentation? Are input Modifiers documented more than just acknowledging their existence?
UInputModifierSmooth is found in InputModifiers.cpp, line 143 onwards. It just takes a player controller, a distance value and a time value and smooths out the movement in that player controller to an average over that distance. It’s a lerp, basically, just using the values in there. But if you want it to do something other that’s in the code, you have to write your own. Or you can write it outside of enhanced input. Like if you wanted to make your VR inputs less raggedy and less likely to make people sick, you could lerp that input, but smoothing isn’t what you want in that instance.
Sometimes you have to read the code. You do have the option of reading the code if you want to know how a native function is doing something.
If you want to see if it’s working then when you play in editor, you can tilde to bring up the console and ShowDebug EnhancedInput. It’ll show you what’s currently active in EnhancedInput.
Reading through the code it still seems to be very much WIP yet exposed to the editor for whatever reason. It seems to be intended for mouse movement smoothing.
The samples taken are set to 1 (apparently as a temporary measure until it accesses KeyState’s samplecountaccumulator…), so I’d say, for now, it does absolutely nothing.
It’s pretty new, tbh it shouldn’t be exposed yet. Or well, new and new - it only recently completely substituted the old input system, but it has been around for a while.
Read on from line 154 in InputModifiers.h and then check the implementation of the function. Some of the Unreal “documentation” is like that.