private void OnCollisionEnter(Collision collision) { playerPickUp pPUScript = GetComponentInParent <playerPickUp>(); pPUScript.canCarry = true; transform.GetComponent <Rigidbody>().useGravity = true; transform.parent = null; Destroy(gameObject.GetComponent <extGrabbedBehave>()); }
private void throwMe() //Throw Physics { playerPickUp pPUScript = GetComponentInParent <playerPickUp>(); transform.GetComponent <Rigidbody>().AddForce(transform.parent.forward * GetComponentInParent <playerBehavior>().throwForce, ForceMode.Impulse); //Adds force to object pPUScript.canCarry = true; //Don't show we can carry till after this thing already starts launching transform.parent = null; transform.GetComponent <Rigidbody>().useGravity = true; Destroy(gameObject.GetComponent <extGrabbedBehave>()); }