Pick Drag drop....Where to find a good example.

Hello Guys,

I am struggling in finding a good/simple example of pick/drag of an object in a 3D scene. I found the DragObject.js on the wiki but I can’t understand how to use it… my scene is really simple, with just one cube but when I click on the object nothing happens…

can anybody address me to something nice and easy to implement?

Thank you
Giancarlo

Have you tried the Drag Rigidbody script that comes with the Unity standard assets?

I created my project empty of those standard assets so…
1- I dunno how to add them into my project and
2- where in the distribution I can find it…

I’ve found anyway the script on the wiki and somehow it works with a pre-allocated object…in the scene, but I have a model uploaded at Runtime it’s an OBJ format model…I add RigidBody, MeshCollider but I can’t grab it! :frowning:

Thank for your suggestion!
GC.

In the unity package mobile package thingy is a dragable ball example check that out

Yup Found it and also gave it a go all working as I wanted but the only thing is that I have a different geometry. I have a model, uploaded in the scene at run time in this way: where gObj is a GameObject. In my scene I’ve put also a cube as part of the standard gameobject, and the picking works with the cube but not with my model :frowning:

gObj.transform.position = Vector3(0,2,0); //Positioning the object in (0,0,0);
gObj.transform.localScale = Vector3(0.008,0.008,0.008);
gObj.AddComponent(“Rigidbody”);
gObj.AddComponent(“NetworkView”);
gObj.GetComponent(“Rigidbody”).useGravity = false;
gObj.GetComponent(“Rigidbody”).isKinematic = false;
gObj.AddComponent(“MeshCollider”);