I am trying to use a GUI.Label to update the score of my game. My problem is I do not know how to get the score to increase on the GUI. I know that label is just used to display information, and I have tried using a string instead, but it didn’t work for me. I might have done it wrong so I am asking for help. Here is my script for the text
EDIT: The GUI shows up and shows a starting score of 0 when I destroy the object in question, the score does not change in the GUI but if I Debog.Log, the score goes up by 1.
hmm from what I seen your code should work I have an example I did too test my health in game it’s in c# through but should be easy too change.
void Update ()
{
if(Input.GetKeyDown(GUIKey))
{
Life -=1;
}
}
it update’s correct when is pressed my GUI label is in another script but works for what you want.