I have a script that calculates the distance between two gameObjects with Vector3.Distance
How can I increase a number from 0 to 60 gradually as one gameObject gets closer to the other?
CodePudding user response:
Basic maths:
Number = 60/(1 Distance);
When distance is infinity, it returns 0.
When distance is 0, it returns 60.