I write a game where I have to do something like scoring. I have created a GUIText Object in the hierarchy and a prefab of it in the project. I have a script that executes some kind of code on a triggered event, where I 'd like to update the guiText’s text content. Well I have a variable called score inside that script which is assigned like this :
var score : GameObject;
In the inspector, I have drag n dropped my score prefab to this variable (I did this on another prefab, where I had previously connected with my script, that I have that triggers a particular event). So when I do the following
score.guiText.text = "My New Text";
The GUIText won’t update on the screen. Any ideas?