public bool drop(Vector3 position) { if (!isHandFree()) { objInHand.parent = null; objInHand.position = new Vector3(position.x, objInHand.position.y, position.z); Rigidbody auxRigidbody = objInHand.GetComponent <Rigidbody>(); if (auxRigidbody != null) { auxRigidbody.isKinematic = false; } TouchProperties tP = objInHand.GetComponent <TouchProperties>(); if (tP != null) { tP.exertPressure(false); } objInHand = null; return(true); } return(false); }
public bool hold(Transform obj) { if (isHandFree()) { obj.parent = hand; Rigidbody auxRigidbody = obj.GetComponent <Rigidbody>(); if (auxRigidbody != null) { auxRigidbody.isKinematic = true; } obj.position = refPosGrabObj.position;//new Vector3(refPosGrabObj.position.x,obj.position.y, refPosGrabObj.position.z); TouchProperties tP = obj.GetComponent <TouchProperties>(); if (tP != null) { tP.exertPressure(true); } objInHand = obj; return(true); } return(false); }