- Home /
Add time score to my game
Can someone please tell me how to add timer so if it goes to 0 its game over Also how can i add score so if for example i kill a robot in my game i get 300 points\
Thank you
Answer by Sriram · Mar 07, 2011 at 09:40 AM
Check out this link for a simple countdown timer script.If you have any experience with programming at all, this should be easy to follow.
http://answers.unity3d.com/questions/42818/problem-with-countdown-timer
Adding simple event based scores are easy, You could have an integer say, int PlayerScore and everytime you kill an enemy increment the variable by whatever you want.
Eg:
int PlayerScore = 0;
void EnemyDead()
{
//Write the logic for what happens when your enemy dies - animation, effects etc
PlayerScore += 300;
//This means that 300 points will be added to the players score everytime the enemy dies.You can print this result using the GUI system. }
Hope this helps!`
Your answer
Follow this Question
Related Questions
GUITime and Score issue. 0 Answers
How to convert 00:40:00.0 to float 2 Answers
Time Based Shooter 0 Answers
I need help for delete old highscore 0 Answers