Parameter increases the closer to an object

In my scene I’m trying to have the vortex image effect angle parameter increase the closer the player moves to an object. Can anybody help me out?

void Update() {
angle = MAXANGLE; //really bad effect on image

    angle -= vector3.distance(object.transform.position, player.transform.position);
  
    //since you want as distance goes down angle goes up.
    //now if your close it subracts nearly nothing, if your on top of it, nothing
    //so you get the full effect. as you back off it subtracts more from the angle 
    //theres your effect. you'll want to cap angle at 0 after
    if (angle < 0)
      angle = 0;

    if you back really far away it goes to no effect and stops.
    
}