protected override void AttachToGrabber(BaseGrabber grabber)
        {
            base.AttachToGrabber(grabber);
            FixedJoint joint = GetComponent <FixedJoint>();

            if (joint == null)
            {
                joint = gameObject.AddComponent <FixedJoint>();
            }
            joint.connectedBody = grabber.GetComponent <Rigidbody>();
            joint.anchor        = jointAnchor;
            joint.breakForce    = breakForce;
            joint.breakTorque   = breakTorque;
        }
Exemple #2
0
        protected override void AttachToGrabber(BaseGrabber grabber)
        {
            base.AttachToGrabber(grabber);
            SpringJoint joint = gameObject.GetComponent <SpringJoint>();

            if (joint == null)
            {
                joint = gameObject.AddComponent <SpringJoint>();
            }
            joint.connectedBody = grabber.GetComponent <Rigidbody>();
            joint.anchor        = new Vector3(0, 0.01f, 0.01f);
            joint.tolerance     = tolerance;
            joint.breakForce    = breakForce;
            joint.breakTorque   = breakTorque;
            joint.spring        = spring;
            joint.damper        = damper;
        }