private void OnTriggerEnter(Collider other) { if (other.name == "tongsPosition" && !lockedIn) { lockedIn = true; pickupObject.Drop(); pickupObject.Drop(); transform.position = other.transform.position; transform.rotation = other.transform.rotation; transform.parent = other.transform.parent; rigidbody.isKinematic = true; } }
private void OnTriggerEnter(Collider other) { //collecting tea if (other.name.Contains("TeaLeaves")) { //print("tea collected"); teaCollected = true; teaClump.enabled = true; } else if (other.name.Contains("teapotLeafDrop")) { inRange = true; } else if (other.name == "scoopPosition" && !lockedIn) { lockedIn = true; if (pickupObject.pickedUpObject == gameObject) { pickupObject.Drop(); } transform.position = other.transform.position; transform.rotation = other.transform.rotation; transform.parent = other.transform.parent; rigidbody.isKinematic = true; } }
private void Drop() { if (IsItemHeld()) { _heldItem.Drop(); _heldItem = null; } }
void OnTriggerEnter(Collider other) { if (other.tag == "OtherPickup" || other.tag == "Teacup" || other.tag == "Teapot" || other.tag == "Pitcher" || other.tag == "Scoop" || other.tag == "Tongs") { if (other.gameObject == pickupObject.pickedUpObject) { pickupObject.Drop(); } other.transform.position = respawnPosition; } }
private void Drop() { if (IsItemHeld()) { _heldItem.Drop(); _heldItem = null; } else { AddReward(-0.01f); } }
private void OnTriggerEnter(Collider other) { if (other.name == "containerLidPosition" && !lockedIn) { if (pickupObject.pickedUpObject == gameObject) { pickupObject.Drop(); } transform.position = other.transform.position; transform.parent = other.transform.parent; rigidbody.isKinematic = true; lockedIn = true; } }
private void OnTriggerEnter(Collider other) { if (other.name == "teapotLidPosition" && !lockedIn) { if (pickupObject.pickedUpObject == gameObject) { pickupObject.Drop(); } transform.position = other.transform.position; transform.parent = other.transform.parent; other.transform.parent.GetComponent <TeapotScript>().topOn = true; rigidbody.isKinematic = true; lockedIn = true; } }