Change font size of drawn Textbox.

Hello there!

I’m working with Unity 2D.

I want to create a a floating text over units heads and it works but i want to change the fontcolor, size and the backgroundcolour of the textbox, how is that possible?

thats my script for now:

        GUI.TextField(new Rect(X,Y,A,B), GetComponent<Player>().damage.ToString());

thats it was the script reference says:

public static string TextField(Rect position, string text, GUIStyle style); 

but if i try to type in the Fontsize or something it says it doesnt exsist. :confused:

Thank you for reading and coming answers, excuse my bad english.

You should probably try to access the TextMesh component and then you can access all the properties of the text !!

text.gameObject.GetComponent<TextMesh>().fontSize or color 

And you can access all the other properties of it