SmoothStep always return 0

Hello,

I’m trying to use FMath::SmoothStep function but I allways get 0, I think I0m missing something, thats an exemple of what I do:

LogClass: a:25.484921, b:170.425293, alpha:0.000000
LogClass: b > a result:0.000000
LogClass: a:25.484921, b:170.425293, alpha:0.125000
LogClass: b > a result:0.000000
LogClass: a:25.484921, b:170.425293, alpha:0.250000
LogClass: b > a result:0.000000
LogClass: a:25.484921, b:170.425293, alpha:0.375000
LogClass: b > a result:0.000000
LogClass: a:25.484921, b:170.425293, alpha:0.500000
LogClass: b > a result:0.000000
LogClass: a:25.484921, b:170.425293, alpha:0.625000
LogClass: b > a result:0.000000
LogClass: a:25.484921, b:170.425293, alpha:0.750000
LogClass: b > a result:0.000000
LogClass: a:25.484921, b:170.425293, alpha:0.875000
LogClass: b > a result:0.000000

Anybody knows what i’m doing wrong?

Thanks

Smoothstep is returning 0 because your Alpha is less than A. Smoothstep expects your Alpha to be a value between A and B and it returns where your alpha falls on a 0 to 1.0 range relative to your A and B.

https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Math/FMath/SmoothStep/index.html

I think you want a simple Lerp instead.

https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Math/FMath/Lerp/1/index.html

Right! I was confused because Unity’s Mathf.SmoothStep, to reply the same behavior I only have to conbine SmoothStep function with Lerp. That was what I was missing.

Thanks