- Home /
This question was
closed Mar 02, 2014 at 09:54 PM by
Fattie for the following reason:
The question is answered, right answer was accepted
Question by
DuckonQuack · Mar 02, 2014 at 07:42 PM ·
scorepointaddingtimed
How do I make a score script based on the time the player is alive?
Hello, I currently have a scoring script that should add points the longer the player is alive. But for some reason when I play the game the score stops at 1 and dose not go any further. Can any one tell me what I'm doing wrong? Here is my script.
using UnityEngine; using System.Collections;
public class HUDscript : MonoBehaviour {
float playerScore = 0;
// Use this for initialization
void Start () {
playerScore += Time.deltaTime;
}
void OnGUI ()
{
GUI.Label (new Rect (10, 10, 100, 30), "score: " + (int)(playerScore * 100));
}
}
Comment
Follow this Question
Related Questions
Score not adding? 3 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Score system 1 Answer
Collision point on surface? 1 Answer
Score system help 1 Answer