Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Not sure how to do it with Unreal Engine's stuff specifically, but the logic is pretty simple. Just create a function that takes in the value, a minimum value, a maximum value, and use if statements to return the proper value. Here's the gist in C++ that you should be able to copy and paste and use directly in UE4:

double Clamp(double value, double min, double max) {
    if (value < min) value = min;
    if (value > max) value = max;
    return value;
}

unfortunately i'm using blueprints, but thanks for trying

Maybe this documentation could help, https://docs.unrealengine.com/en-US/BlueprintAPI/Math/Float/Clamp_float/index.ht...