Picking up objects

I am trying to create a simple version of a robotic arm to pick up an item, move it and place it somewhere else. i have programmed button controls for independent movements but I cannot pick up the box. when i add physics everything falls to the ground or if static doesn’t move with the arm movement. I applied physics to each part of the arm but lack the same control and motion. Any ideas?

1 Like

Hi Daniel,

we are internally testing some concepts to combine physically simulated items with non-physics items to make what you’re trying to do possible. Right now, items that use physics can only be moved with the “Physics” category blocks. So there’s no easy way to program a robotic arm with claws via Blockly alone.

However, you could try to use colliders and replace the claw with a magnet head instead. If items enter the ‘magnet area’ (checked via collider), and if the magnet is ON, then move the item with the magnet head. If the magnet is OFF, the item is added to the physics simulation and drops down.

Here’s how it could work. Note that the box is not a physics item at the start of the scene.

This is the Blockly code.

-The box waits for a collision of an invisible object that is attached to the MagnetHead, called MagnetHeadCollider
-If the box collides with the MagnetHeadCollider, and if the magnet was enabled before the collision, we parent the box to the MagnetHead item.
-Whenever the magnet is disabled from this point on, the “disableMagnet” function detaches the currently carried item and adds it to the physics simulation.

I hope this example can help you to find another solution to the robot arm problem!

1 Like

Thanks for sharing.
but I can’t find the "Add item to physics.

Thanks for pointing that out! We’ll add the “add item to physics” block with our next update. You can use a JavaScript block like this and write the following to achieve the same effect until it is released (see picture below).