How to limit the moving radius of a character by being fixed to objects, walls, etc. that the character is touching

I am a student in education.
working on a physics based project.
When a button is pressed in a body with physics animation applied, the world location of the hand is fixed or fixed to an object (landscape, actor, component) that the hand touches, and the character can move but the range that can be moved by the fixed hand I want to know how is limited.