void Update() { if (Input.GetKeyDown(KeyCode.E)) { for (int i = 0; i < PrisonerPrefab.Length; i++) { Invoke("_prisoner[i].callRollCall()", UnityEngine.Random.Range(1, 5)); } } } From unit console:
Trying to Invoke method: PrisonsAI._prisoner [i] .callRollCall () couldn't be called.
i < PrisonerPrefab.Length, and then you call methods on_prisoner[i], shouldn't there bePrisonerPrefab[i]? - Mikhail MurugovInvokemethod, because it greatly affects performance. - Mikhail Murugov