Oops! What have I broken now?

In Unity 2, this code no longer seems to work … thoughts?

function OnMouseDown () 
{ 
    hinges = FindSceneObjectsOfType (HingeJoint); 
    for (var hinge : HingeJoint in hinges) { 
    hinge.spring.damper = 0; 
    hinge.spring.spring = 2; 
    } 
}

function OnMouseUp () 
{ 
    hinges = FindSceneObjectsOfType (HingeJoint); 
    for (var hinge : HingeJoint in hinges) { 
    hinge.spring.damper = 100; 
    hinge.spring.spring = 2000; 
    } 
}

Hi DaveyJJ,
I tried your script in 2.0 and it works for me. What exactly is it doing for you?

Neither my monkey or giraffe are now collapsing. Hmm. I figured it’s right … let me look into a bit more.

Would using the motor or using limits at all affect it? Should I check those off now?

Thanks, Daniel.

No, I don’t think that those would affect it. Maybe post a unity package with the bug in it.

Some people had issues with the wheel collider on upgrading and had to retweak its values. Maybe try changing the values you assign to your hinge joints?

I’ll try that.

Fixed it! I unchecked “Use Motor” and “Use Limits” and it’s all fine again.

Weird, huh?

Weird. 8)