void GetGrabbed(ExtendedHand grabbingHand, GameObject colliding) { Debug.Log("Attaching joint"); snakeController.SetRagdoll (true); Physics.IgnoreLayerCollision(8, 9, true); var joint = gameObject.AddComponent<FixedJoint>(); joint.connectedBody = colliding.GetComponent<Rigidbody>(); joint.enableCollision = false; grabbingHand.grabbedObject = gameObject; }
void Awake () { leap = new Controller (); leftRigidHand = GameObject.FindGameObjectWithTag("LeftRigidHand"); leftHand = new ExtendedHand (); leftHand.rigidHand = leftRigidHand; rightRigidHand = GameObject.FindGameObjectWithTag("RightRigidHand"); rightHand = new ExtendedHand (); rightHand.rigidHand = rightRigidHand; }