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

1 Answer

1

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!`