IEnumerator CloseDoor() { open = false; startMarker = transform.position; transform.localPosition = Vector3.Lerp(startMarker, originalPosition, speed); yield return null; }
private void OnTriggerExit(Collider other) { if (other.tag == "Ball") { currentWeightOnPlatform -= other.GetComponent <Rigidbody>().mass; } if (other.tag == "Chair") { currentWeightOnPlatform -= other.GetComponent <Rigidbody>().mass; } if (other.tag == "Player") { currentWeightOnPlatform -= other.GetComponent <Rigidbody>().mass; } door.CloseDoor(); }