c++ clamp

Hello! I Followed this tutorial to make custom game user settings…

also i added ability to manage anti aliasing method (r.AntiAliasingMethod)
and it’s working great! But my question is how can i clamp Aliasing variable?.. i know how to clamp from bp, but i need in c++ (I don’t know c++)

i will be very glad for help :wink:

clamped_value = FMath::Clamp( value, min, max )

If you know how to do it in blueprint, you can (almost) always double click on the blueprint node and the implementation will be brought up in your IDE. Sometimes you call that function directly or in cases like this, you just call the one function that blueprint implementation is calling.

i tryed to clamp but it’s just not working. I also tried to clamp value directly where i set r.antialiasingmethod, but it’s giving me error. What i am doing wrong? where i need to clamp my variable?.. (sorry, i really don’t know c++) :((((

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.

Thank u very very much! Yep, i am planning to start learn c++ ;))
thank u again