I dont know really what to search for and what i search for isnt what im looking for.
I’m looking for a script that when a player does something (and activates a trigger), a GUI text shows up as a dialouge.
And i want to be able to change the time it showing with a variable.
Not tested, but you should get the idea
private string popupText;
private bool isPopupActive;
public IEnumerator activatePopup(string text, float duration)
isPopupActive = true;
popupText = text;
while (duration > 0)
duration -= Time.deltaTime;
yield return null;
isPopupActive = false;
private void OnGui()
GUI.Button(new Rect(....), popupText);
Call it by:
StartCoroutine(activatePopup(“This is a popup”, 2.0f));