i’m creating a in-game tutorial for my game…
i’m using GUI.Label for my message in my in-game tutorial
once the in-game tutorial starts… the first message comes out…
after 5 or 6 seconds… the next message will show…
but since GUI.Label in only use inside the OnGUI function… i don’t know how to delay the appearance of the GUI.Label…
i’d tried IEnumerator but i can’t use OnGUI in StartCoroutine.
please help
Try this.
Have a string var for your message which is always displayed. Then a separate coroutine which sets the string var.
E.G
// This method lets you set the messages in the inspector, its rough c#
public string myMessage = "";
[serializable]
public class Message
{
public string message;
public float delay;
}
public Message[] messages;
IEnumerator Start()
{
foreach( Message m in messages )
{
myMessage = m.message;
yield return new WaitForSeconds( m.delay );
}
}
void OnGUI()
{
GUI.Label( myMessage....);
}
Or u can also use 3d text for displaying all message with 3d text u can control where u want to show or hide a text.