SmoothStep UMG implementation not smoothing "in".

Hi all, im very new to Unreal but not new to programming or embedded work.

Ive created a UMG SmoothStep node setup based on the common function.


float smoothstep (float edge0, float edge1, float x)
{
   if (x < edge0)
      return 0;

   if (x >= edge1)
      return 1;

   // Scale/bias into [0..1] range
   x = (x - edge0) / (edge1 - edge0);

   return x * x * (3 - 2 * x);
}

But while the Smooth Out at the beginning is working. The smooth IN at the end is not and my UI animation is slapping hard into the end.

I am feeding in a linear float of 0-1 and i should be getting a smoothed out float of 0-1.

Normally with embedded id run this kind of UI animation based on a fixed frame rate. But as that is more variable in this engine, I’m using it based on time, and time elapsed since the start.

This is my setup…
Its still a work in progress and things will be organised differently later, I just want to get the basics working first.

On the main UI widget bluprint.
On the event start, after forcing screen res, I set a few veriables. Animation length 1000, reset the LoadAni to 0 (load ani is the main multiplier thats being fed into smoothStep, and then grabs the current time in milisends, adding the animation length to this number for later…

On the event tick which i assume is each UI draw or program loop.

First checks to see if Load Ani has readed 1 to clamp it at one and stop the animation…
If bellow 1 runs Update Load Ani

Here current time is checked again. Minus the end time to see how much closer we are to the end of the animation.
The main multiplier of 1 is divided by animation length.
This is then multiplied and fed into the smooth step function.

What comes out should be the smoothed version.

In my On paint


I have a bunch of functions that draw primitive lines using sin cos.


LoadAni is the multiplier used here to set the end posision of the guage arch being drawn as part of the startup animation.

Anyway if anyone can see what im doing wrong and point it out for me… That would be really great…

Thanks