Found different solution.
RayCastHit Not Returning Rigidbody
Hello, I am making a 2D airship game. I have made a script that makes a object when the player left clicks and cycles though objects on right click. I now need to make the script make a fixed joint when the player clicks "X" . First, I have a script that send's a raycast out every frame from the main camera. I need to get the rigidbody from the object that the raycast hit's. When the raycast hits, I want object's rigidbody to be set to a different variable so I can set the Fixed Joint's "Connected Body". The code continues to return null even though it's hitting a Rigidbody with a raycast. What am I doing wrong? The line that doesn't work is hitObject = hit.rigidbody; Full Code: http://pastebin.com/dXdVF83T (For format)
Never $$anonymous$$d, found a different way of doing it.