- Home /
Making a Text Timer and Score Display
Greetings, and thanks to all who helped in previous questions!
I want to make text on screen that changes to display the remaining time in a game, or time until respawn. Also, I want to display the player's current score. The game and interface are 2D. How do I do this?
(I tried GUIText objects, but they stayed in place when I moved my view. Not want I wanted.)
Answer by pheash · Jul 24, 2012 at 09:15 AM
here are free video tutorials showing you how to create a counter or timer using graphical text: http://www.walkerboystudio.com/html/unity_course_lab_3.html
if you simply want a bit of text displayed, use
function OnGUI(){
GUI.Label(Rect(0,0,50,50),"The Game Time is: "+Time.time);
}
here is a good starting point to read up on what unity gui provides:
http://docs.unity3d.com/Documentation/Components/class-GUIStyle.html
hey I saw on your profile that you have a lot of unaccepted answers, if there is an answer to your question that helped you please mark it as accepted so the forums stay clean. or post further comments asking for clarification..
Answer by Endarire · Jul 27, 2012 at 10:37 AM
Thanks. I'm still new at this.
hehe no worries, ideally you would have written that as a comment and not a new answer, since it isnt an answer to your question :D
Your answer
Follow this Question
Related Questions
How can i link my code together so the score value affects the timer value 1 Answer
Why can't I call function from another script? 1 Answer
Time Score? 1 Answer
Simple score system breaking crates 1 Answer
How to add score with no trigger 0 Answers