- Home /
Gui label delay
I have the next code, so i just want to make some delay for ShowPoints.
public int Points;
public bool ShowPoints = false;
totalKIlls ++;
ShowPoints = true;
if (ShowPoints = true); {
Points += 100; }
\\\\OnGui\\\\\
if(ShowPoints == true)
GUI.Label(new Rect(Screen.width/2-50,Screen.height/2-25, 100, 50), ""+Points);
i've tried to make it throught yield and couroutine but it give me errors, any ideas?
Answer by EarMaster · Aug 30, 2013 at 03:26 PM
So you want the score display to stay the same for some time and then be increased by 100?
My suggestion would be to put the Points += 100; part into an own function (it's hard to tell what part of your code you posted) and call this using Invoke("NameOfYourFunction", 1); (the second parameter is the delay in this case 1 second).
Nope, i just want i have +100 every time when i kill, so i just need to make some delay for 2-3 sec , because +100 disappear very fast. An own function? i can't because it happen when i do totalkills++
Your answer
Follow this Question
Related Questions
delayed function problem 1 Answer
GUI.Label positioning for many device resolutions 1 Answer
network GUI not working 1 Answer
Unity GUI text displaying as noise 1 Answer
show entered amount gui/label 2 Answers