Detect radius from object

Hey guys,

I want my character to be able to interact with objects via right clicking when within a certain radius of that object, how can I have the game read the characters distance from the object?

Thanks,

JPiiONEFOURONE

You can use the function OnTriggerEnter, either on the character or the clickable object. Or you can call Physics.OverlapSphere to check if it close enough. Or you can detect the click, check the distance and then do something if the dist is correct.