6 namespace HoloToolkit.Unity.InputModule.Examples.Grabbables
35 base.AttachToGrabber(grabber);
36 SpringJoint joint = gameObject.GetComponent<SpringJoint>();
39 joint = gameObject.AddComponent<SpringJoint>();
41 joint.connectedBody = grabber.GetComponent<Rigidbody>();
42 joint.anchor =
new Vector3(0, 0.01f, 0.01f);
43 joint.tolerance = tolerance;
44 joint.breakForce = breakForce;
45 joint.breakTorque = breakTorque;
46 joint.spring = spring;
47 joint.damper = damper;
52 base.DetachFromGrabber(grabber);
53 SpringJoint joint = gameObject.GetComponent<SpringJoint>();
56 joint.connectedBody = null;
58 StartCoroutine(DestroyJointAfterDelay(joint));