Ok so it’s basicly easy to change the text on a Gui.
But i’m trying to change the text of a Gui when the script is applied to the main camera.
The reason i want to know how to do this, because i don’t have to create scripts for each Gui.
So how can i access the Gui from a script attached to an other object ?
Appreciate any help.
~Wentzel
Get a reference to the script where the GUI is written and use a variable as GUI text.
var guireference:NameofScript
guireference = camera.GetComponent(NameofScript);
guireference.GUIText = "blabla";
You can use GameObject.Find(“object name here”).GetComponent().text =
Or you could create properties in your script that are something like public GUIText MyTextObject and set it in the editor to be your gameobject.