How can I display a Text after I collided with a GameObject? I tried this:
void OnGUI()
{
guiStyle.fontSize = 66;
guiStyle.fixedHeight = 66;
guiStyle.fixedWidth = 66;
guiStyle.normal.textColor = Color.white;
GUI.Label(new Rect(10, 10, 100, 20), "Score: " + score, guiStyle);
guiStyle1.fontSize = 200;
guiStyle1.fixedHeight = 66;
guiStyle1.fixedWidth = 66;
guiStyle1.normal.textColor = Color.white;
}
private void OnTriggerEnter2D(Collider2D collision)
{
GUI.Label(new Rect(10, 10, 100, 20), "Score: " + score, guiStyle1);
}
}