public void ActivateRandomPrompt() { //update lists GetLocationLists(); //Transform _detach = _myList[Random.Range(0, _myList.Count)]; GameObject Prompt = prompts[Random.Range(0, prompts.Length)]; //freeplay means all locations are open if (promptsWaiting.Count < maxOpenPrompts) { PromptLocation randomLocation = openLocations[Random.Range(0, openLocations.Count)]; IsoObject iso = randomLocation.GetComponent <IsoObject>(); Vector2 promptLocation2D = isoWorld.IsoToScreen(iso.position); //Debug.Log("iso to screen: "+promptLocation2D); GameObject promptModal = Instantiate(Prompt); promptModal.transform.SetParent(canvas, false); promptModal.gameObject.GetComponent <Prompt>().promptLocation = randomLocation; //Debug.Log(promptModal.gameObject.GetComponent<Prompt>().promptLocation); promptModal.gameObject.GetComponent <RectTransform>().anchoredPosition = promptLocation2D; randomLocation.GetComponent <PromptLocation>().prompt = promptModal.GetComponent <Prompt>(); //promptModal.GetComponent<Prompt>().detailsText = randomScenario.details; } }