Is there a script for picking up rigid bodies with the mouse via a spring joint?

I’ve seen some scripts that let you pick up a rigid body with a mouse drag by simply re-positioning the object, but this wreaks havoc on rigid bodies, especially when they are attached to other bodies with joints.

Is there a commonly used script for picking up rigid bodies that uses a spring joint between the mouse position and the target rigid body? I have searched high and low for one and I just wanted to check before I started writing my own script. Thanks!

you mean like the drag rigidbody script that comes with unity?

lol, probably! I'm a total noob with Unity, so how do I use the drag rigid body script?

Thanks, that's exactly what I needed. If you want to write up the answer, I'll check it as answered. Thanks!

np, good luck with your unity experience :D

1 Answer

1

alright well just go to assets>import package>scripts

then you can drag the drag rigid body script onto an object in the scene, you can also use the component menu on the top under scripts

StopCoroutine(Invisibility); won't work and will give an error saying that the StopCoroutine method has invalid arguments (which implies it asks for the string). I have Unity 4.6 so I should have the overloaded method but apparently, this is not how it's used

Oh! My bad. Just understood [the documents][1] that Please note that only StartCoroutine using a string method name can be stopped using StopCoroutine. Sorry for bad answer. [1]: http://docs.unity3d.com/ScriptReference/MonoBehaviour.StopCoroutine.html

So, only solution is what you have thought, use bool. Just found out example [here][1] [1]: http://answers.unity3d.com/questions/300864/how-to-stop-a-co-routine-in-c-instantly.html

Yeah I thought of that solution but it seems just way too lame and crude... I can't believe there's no other way to do this... what the hell :\