Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

map range clamped unity

public static float MapClampRanged(float OldValue, float OldMin, float OldMax, float NewMin, float NewMax)
{
float OldRange = (OldMax - OldMin);
float NewRange = (NewMax - NewMin);
float NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin;

return (NewValue);
}
 
PREVIOUS NEXT
Tagged: #map #range #clamped #unity
ADD COMMENT
Topic
Name
4+9 =