Select the ‘Vacuum Gripper’ and Click Add Component
Add Vacuum Gripper Base
Add a Rigidbody Component
Set the Rigidbody component to:
Use Gravity Off
Is Kinematic On
This way we can control the gripper and interact with other PhysX components.
Lets leave this part for now and continue with setting up the suction cups
Setup the Fingers
Select one of the Suction Cups
Add Vacuum Gripper Finger
Add Box Collider
Set the Box collider to Trigger
Drag the collider into the Trigger field
It should now look like
If the collider is not a trigger it will show you this error in the console:
Do this for all Cups (1 to 4)
Continue with setup of the Vacuum Gripper
Select the Vacuum Gripper (base)
Add the vacuum fingers that you just created. You can do this by dragging the fingers on the add object field, or you can add it with the select button from the object field. Selecting one will add it immediately to the list.
Set the Activation Percentage to for example 0.8. This will overwrite the values on the fingers. If you select one of the fingers, the current value will show up
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 Vacuum Gripper
Create an empty gameoject and name it ControlPanel
Go back to the Vacuum 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
In the ‘Scene’ view of unity you can test the gripper by dragging the ‘VacuumGripper’ assembly on top of the ‘Box’ in such a way that the green colliders are penetrating the Box.
The easiest way to do this is set the unity view to Isometric and place the camera to one side:
If you move the VacuumGripper through the box it will push it like any other unity Physx Rigidbody component
If you move it away from the box, nothing will happen.
Now, if we close the gripper (press close in the VacuumGripperBase component or on the control panel you will see the live data status update.
The value will increase to (at least) the percentage to activate and the state turns to ‘Closed’.
If you now drag the Vacuum Gripper assembly straight up, the box stays connected to the gripper.