c++ clamp

Aliasing = FMath::Clamp(NewValue, 0, 4);

learncpp.com

I wouldn’t really recommend trying to do C++ in Unreal if you don’t know C++. You need to learn it a bit (which should make it obvious what you were doing wrong) before doing work in a C++ project.