I added one HingeJoint for each of its side connected with its body.
It can close or release very well by using HingeJoint’s motor.
However, when i tried to grip a sphere rigidbody, the sphere always split out of the grasper, even though, i added frictions (physic material) with maximum dynamic/static friction and maximum combine mode to both side.
I also tried to reduce the rigidbody’s mass, but it still didn’t work.
If this is possible, any suggestion or other alternative ways to implement this ?.
While it may be very possible to do purely physics based, you’d need to play around with a lot of settings to get it right.
I assume you have set the physics material on both the grasper and the object you are picking up to have those friction values?
If you don’t come right an alternative would be to create a trigger that sits in the middle of the graspers ‘sweet spot’. Then if the grasper closes, and your object is within the trigger, parent the grasper to the object being picked up and set it to isKinematic = false. If the grasper opens again just do the reverse.
Of course there are other workarounds to make this more realistic like if you swing the grasper too hard and the object can fall out… you could attach the object with a joint and set a break threshold too.
Sorry for the answer on such an old question but recently I was trying to accomplish roughly the same thing - picking up an object using friction from a robotic gripper.
I found that the easiest way to achieve this was with a ConfigurableJoint set to squeeze the target object and then setting velocity of the pincers to raise the object off the ground.