|
I want to click on an object and move it with my mouse. I have a prefab object with a rigidbody & springjoint. I applied dragrigid body script to the prefab in the project view, i get following error: NullReferenceException: Object reference not set to an instance of an object DragRigidbody.Update () (at Assets\Standard Assets\Scripts\DragRigidbody.js:20)
(comments are locked)
|
|
The DragRigidBody script doesn't go on the RigidBody you want to drag, it goes on a controller script such as First Person Controller. An in-depth explanation can be found here: http://answers.unity3d.com/questions/4898/drag-gameobject-with-mouse
(comments are locked)
|
|
apply the rigidbody to the object you want to drag than select your camera and apply the drag rigidbody to the camera use mouse to drag
(comments are locked)
|

apply the script to the camera
first apply the rigidbody from component physics then apply the script to the camera
apply rigidbody to the object you want to drag