For some applications, you might want the robot to move toward a part until the object is being detected by the vacuum gripper.
There are different ways to do this but here's a very simple one.
First, make sure the Wait until object is detected is NOT selected in your Vacuum Grip, and set a timeout long enough for the robot to reach the part before it times out.
Then create an IF statement with Check expression continuously selected and enter the following script function from the UR function menu. This function will return the state of the detection.
Then "= with the ? sign" -->False
As long as a part is NOT detected, the robot will move toward waypoint 2
A moveL should be used when moving toward the part.
Note: Waypoint 1 is the approach point, Waypoint 2 is the farthest possible position, Waypoint 3 is the retract waypoint
Important: Make sure the speed is slow enough to let enough time for the robot to decelerate when it detects the part.