How do I make a value increase the closer you get to a part

I ran into the same problem and realized that the equation they provided actually decreases the value instead of increasing. The correct equation would be:

math.clamp(MIN + (MAX - MIN)*(1-(distance/maxDistance)), MIN, MAX)
7 Likes

is there a way to do this but with vector3s because when i multiply vector threes with the result it doesnt multiply it how i want it to