Hello! I'd like to create a function inside a tool that when the player clicks mousebutton 1 it will check what object the player clicked on, and how far the player is from the object he clicked on. Like with a click detector, if you are within 5 studs and you click it, it runs a function. Kind of like that except you can only click with the tool selected. Thanks!
Note: Just tell me what APIs/Objects to use and if there is any equation to check how far the player is. Whether it be to calculate it from Vector3 or something else.
