private void OnTriggerStay(Collider other) { if (other.transform.tag == "container") { CookingContainer cookCtrl = other.transform.GetComponent <CookingContainer>(); cookCtrl.AddCookingProgress(cookRate); GameObject inst = Instantiate(smokePfx, other.transform.position, other.transform.rotation); Destroy(inst, 3f); } }
// Use this for initialization void Start() { Initialise(); objCtrl = GetComponentInParent <CookingContainer>(); }