public virtual void Start() { if (!handTarget.physics) { AdvancedHandPhysics.SetKinematic(handTarget.handRigidbody); } }
public static void LocalLetGo(HandTarget handTarget) { //Debug.Log("LetGo"); if (handTarget.hand.bone.transform == null || handTarget.grabbedObject == null) { return; } if (handTarget.humanoid.physics) { AdvancedHandPhysics.SetNonKinematic(handTarget.handRigidbody, handTarget.colliders); } //AdvancedHandPhysics.SetKinematic(handTarget.handRigidbody, true); //handTarget.colliders = AdvancedHandPhysics.SetKinematic(handTarget.handRigidbody); Joint joint = handTarget.hand.bone.transform.GetComponent <Joint>(); if (joint != null) { LetGoJoint(handTarget, joint); } else { LetGoParenting(handTarget); } if (handTarget.humanoid.physics) { handTarget.colliders = AdvancedHandPhysics.SetKinematic(handTarget.handRigidbody); } if (handTarget.humanoid.dontDestroyOnLoad) { // Prevent this object inherites the dontDestroyOnLoad from the humanoid Object.DontDestroyOnLoad(handTarget.grabbedObject); } LetGoGrabbedObject(handTarget); }