I want to pick up a rigidbody block with an onclick function and be able to move it around my scene. So if you click and hold, you carry the block, but if you stop holding down left click, the rigidbody block falls. Can anyone help please?
Check out Unity Wiki for the DragObject.js script.
Ok I found the dragObject.js now the only problem is is all i can do is drag… does anyone know how to make me be able to lift it and such?
Spend a few minutes investigating its interface and you will be rewarded. DragObject.js definitely supports lifting, if you set the appropriate member variables.
when i attempt to add lift, it just slides across the ground instead of going up…
How did you attempt to add lift? Did you try setting “Add Height When Clicked” = 3? Here’s a YouTube video of me dragging dropping a sphere with DragObject.js proviing that it can be made to work:
Im using it in the 3d environment, the one you did was in a 2d plane.
DragObject.js is intended ot be used by a camera looking down, per its description:
“This is similar to DragRigidbody, but much more stable and with more direct control. In its current form, it’s intended for use with a camera looking down on the X/Z plane and dragging objects on a flat planar surface, but it could be adapted to be more flexible if desired”
If you want a different camera orientation you’ll need to extend it.