public void GetThrown(Vector3 direction) { if (beingCarried == CarriedState.CARRIED) { beenThrown = ThrownState.THROWN; beingCarried = CarriedState.NOT_CARRIED; transform.parent = null; rb.isKinematic = false; rb.AddForce(direction, ForceMode.VelocityChange); } }
public void BeInteractedWith(GameObject actor, Transform pos) { if (beingCarried == CarriedState.NOT_CARRIED) { // Being picked up beingCarried = CarriedState.CARRIED; rb.isKinematic = true; holder = actor; transform.position = pos.position; transform.rotation = actor.transform.rotation; transform.parent = pos; } }
// Use this for initialization void Start() { beingCarried = CarriedState.NOT_CARRIED; rb = GetComponent<Rigidbody>(); audioSource = GetComponent<AudioSource>(); if (leftIKHandle == null || rightIKHandle == null) { Debug.LogWarning("IK handles are not set for " + gameObject.name); } }