Hi, i would like to do something after OnTriggerStay check everthing i ask for. So I have some object on my map i want to add only those which have contact with trigger and when i collect them all i need to do something. My problem is that i don't know how to start it AFTER i got them all. Code (CSharp): public void OnTriggerEnter(Collider other){ if(other.tag == "OBJECT") { if(!powerSupplyTo.Contains(other.gameObject)) powerSupplyTo.Add(other.gameObject); } } So here i collect all object i need but i cannot put "AddPowerTO(powerSupplyTO)" here because it will do it as many times as many object will collider with my Trigger. So i need first to get them all and then "AddPowerTO(powerSupplyTO)"
well you could add public int MaxObjectsCount and int CurrentObjectsCount; for example and set the Max number you want through inspector.you can leave currentObjects private. and each time you pick one up, say CurrentObjectsCount++; and then check if currentObjects == MaxObjects if so ... do something. Or you could add public int MaxCount and then after each pickup check if ( powerSupplyTo.count == MaxCount) if so, do something.(of course only if the powerSupplyTo is list of pick-ups only.