public void Interact() { if (carryState == CarryState.NOT_CARRYING) { if (status.debugging) { Debug.DrawRay(transform.position + transform.up * 0.5f, transform.forward * pickupRaycastDistance, Color.magenta, 0.3f); } RaycastHit hit; Ray pickupRay = new Ray(transform.position + transform.up * 0.5f, transform.forward); if (Physics.Raycast(pickupRay, out hit, pickupRaycastDistance)) { if (hit.collider.tag == "Throwable") { // Object is a throwable, pick it up GameObject obj = hit.collider.gameObject; heldObject = obj.GetComponent<Throwable>(); carryState = CarryState.CARRYING; heldObject.BeInteractedWith(gameObject, carryPosition); } } } else if (carryState == CarryState.CARRYING) { carryState = CarryState.NOT_CARRYING; heldObject.GetThrown(transform.forward * throwStrength); heldObject = null; audioScript.Throw(); } }