Getting a smaller number from a larger distance

I know that the title is extremely vague and doesn’t really explain much but what I’m trying to do is this.


When parts are very close like this I want to be able to subtract their positions and somehow get a larger number than if the parts were further apart than each other.
For example the image shown above would give an output of 30 while the image here image would give an output of 5.

someMultiplier / distanceBetweenParts

Edit: what are you using this for?

3 Likes

You didn’t specify exactly how you want the numbers to be transformed, only that bigger=smaller and smaller=bigger. I use desmos for figuring out this stuff sometimes.

I was going to try this while making custom explosions a while ago when I wasn’t able to ask questions on the forum and I just ended up giving up on that. Now I just want to change the player’s camera FOV based on how far away the character is. For example if they’re super far away the FOV lowers and when they’re close the FOV gets higher. This did work though so thank you for that.

1 Like