function OnGUI()
{
GUI.Box(Rect(((Screen.width)/2)-45,(((Screen.height)/2)-25)-60,90,50), "Score: " + playerScript.score, fontVar); //Shows user’s score (I want that to show immediately)
//I want the pause here. I’ve tried yield WaitForSeconds(1); but it tells me that OnGUI() cannot be a coroutine.
//first i would set time offset and some kind of "checker" to know if time was set
public float dispOffset = 1.0f;
private bool tikeWasSet;
// ...
// next you need action to set when to display theM
if(someKindOfActionWasDone){
timeToDisplay = Time.time + dispOffset;
timeWasSet = true;
}
void OnGUI(){
if(timeWasSet && Time.time >= timeToDisplay){
//your delayed code here
}
}
Updated answer. This has actual time functionality. Once again, my C# Visual Studio friend helped me. Why were all of the answers here so much more complicated?