Lets leave this component and start setting the fingers
Setup of Parallel Fingers
Select the GripperRight
Add Component DSpline
Unfold SplineControlPoints and select Point
Move this to position 0, 0 ,-0.5
Add Component DPrismatic Joint
Drag the newly created DSpline in the DPrismatic Joint
Add Parallel Gripper Finger Component
Add Box Collider
Add Rigidbody Component
Use Gravity Off
Is Kinematic On
Drag the Rigidbody component into the Parallel Gripper Finger and make sure the callback method is set to Rigidbody.
Repeat these steps for the other gripper fingers
The only difference is the positioning of the spline control points
Here you have two options.
You do it with the same offset and invert the finger in the Parallel Gripper Base inspector, or (more preferably) swap position of point and point to make sure point is the open state and point the closed state.
Continue with the parallel Gripper Base
Now we can go back to the ParallelGripper GameObject
Here we need to add the fingers to the base
Drag the Fingers, or open the Selection tab
Because we use the Prespective Prismatic Joint we also need a Kinematics controller. Kinenmatics controller can already be included in the chain when the gripper is used as an end effector on for example a robotarm.
In this example we don’t have it connected to anything, so we need to add it to the Parallel Gripper Base.
Create a Control Panel
You can create a control panel to modify to enable the gripper from another gameobject. This can be useful if you place all control panels on one object to get an overview.
Create the control panel by pressing the Generate Control Panel button.
Now you see a new MonoBehaviour being placed on the Parallel Gripper
Create an empty gameoject and name it ControlPanel
Go back to the Parallel Gripper and drags the Control Panel Interface UIE to the newly created ControlPanel GameObject.
You can now control the Gripper from this Control Panel GameObject when Unity is in playmode.
Test the Gripper
Unity does not provide Kinematic- Kinematic contact pairs. This should be enabled per project. If the setting does not align with the expected setting, this shows up in the inspector and shows the option to set it to Kinematic – Kinematic contact pairs or to All contact pairs. Otherwise the finger-finger collisions are not picked up by Unity’s PhysX. You can also change this setting in the Project Settings
The gripper can be placed above the Box to be picked up
Press the close button on the inspector to close the gripper
Now the grippers are moved inwards and will stop when the hit the box object. The inspector shows the gripped object
Now you can move the gripper around until the gripper is ‘opened’.