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?
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.