Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity normalize float

//Calculate the normalized float;     
normalizedFloat = (i - min) / (max - min);
//Clamp the "i" float between "min" value and "max" value
i = Mathf.Clamp(i, min, max);
//Clamp the normalized float between 0 and 1
normalizedFloat = Mathf.Clamp(normalizedFloat, 0, 1);
 
PREVIOUS NEXT
Tagged: #unity #normalize #float
ADD COMMENT
Topic
Name
8+3 =