Hi Folks… this may seem like a weirdly simple question and I’m kind of embarrassed to ask. But I haven’t seen it anywhere: what is the best (smoothest, controllable, performant) way to smooth constant incoming values (float, vector, rotator, etc) in Blueprints?
Like for instance, something like smoothing a mouse float input.
i believe your talking something akin to the following picture. i was thinking a similar idea but i initially though about changing the sample rate rather than the number of samples but it still accomplishes the same thing.
oh and my example may not be perfectly optimized fyi.
or depending on the data being processed and how it needs to be used you could just divide, round, multiply, which will give you an approximated value but wont account well for large spikes in the value.
@… this also did kind of occur to me, but I’m not sure how it would work with a value …to be smoothed out… coming in on each frame. I can understand how a timeline would work to blend from one set of values (say 0 = mouse input float strength) to another (1 = full mouse input float strength).
But I’m not sure how a timeline would smooth out a stream of mouse input float values… I’m open to suggestion though:)
There’s a way to approximate the moving average idea without storing more than one value. Rather than storing the last N values and computing a moving average, you can do this cheap way by just storing one previous value instead. It’s not as accurate, but often good enough depending on how the values are changing over .
If you want to smooth as if you had a 10-sample moving average, you could do this