What I am trying to do is, I want to make it so I can only jump if I am within 1 unit of the walls. How would I do that? How would I count how far player is relative to wall?
float distance = Vector3.Distance(a.position, b.position) where a and b are transforms of the player and the wall
One way I can think of to do this is to make a trigger collider component on your player model that extends beyond the player for 1 unit. When within 1 unit of the walls, this trigger would activate and you can use this as a check before allowing the player to jump. You can tag the walls and check against that too to make sure it’s a wall that triggered the collider if there are other objects in your scene that you don’t want the player to be able to jump over.