- Home /
Dragging Rigid
Hey All, I am working on a project that invovles dragging rigidbodies. Which was working fine until I discovered that as soon as I instantiate an object that has the Drag Rigidbody script attached to, I can drag all other rigidbodies. Even if they don't have the script attached. What is going on?
Answer by MibZ · Sep 27, 2012 at 09:16 PM
You're using Unity's default JS DragRigidbody script, correct?
That script doesn't effect just the object it is attached to, it works by casting a Ray from the main camera to where you click and tests to see if the GameObject the ray intersects with has a Rigidbody component attached, so the script is doing exactly what it is supposed to.
You need to either find or write a new script, if you know how to code you shouldn't have a problem finding the lines of code you want inside the DragRigidbody script.
Right, I see. Okay thanks, I'll try and come up with some clever solution.
Your answer
Follow this Question
Related Questions
Drag around riggidbodies with a "pin" 0 Answers
How to move a group of objects with rigidbodies together? 2 Answers
How can i set AddRelativeForce relative to how fast/slow im moving my mouse? 2 Answers
how do you activate a sound effect when two objects with box colliders hit? 0 Answers
Detect screen tap vs. drag 2 Answers