The question is answered, right answer was accepted
2D game score
Hello,
I am creating a 2D game with falling objects which you have to catch. But now I want to update my score when I catch them. I have a score script and a UI text.
This is my c# score script:
public Text scoreText;
public int krolschValue;
private int score;
void start () {
score = 0;
UpdateScore ();
}
void onTriggerEnter2D () {
score += krolschValue;
UpdateScore ();
}
void UpdateScore () {
scoreText.text = "Score:\n" + score;
}
}
On the onTriggerEnter2D my Value should be updated by one. But it does not show on the screen. I have no errors so I have no idea what the problem is..
Bram
Follow this Question
Related Questions
Multiple objects being triggered 0 Answers
how to move score system through scenes with SceneManager.MoveGameObjectToScene 0 Answers
Calling Input from another script 3 Answers
Help with 2D platformer (score),For my 2D game sometimes coins get added twice to the score?! 0 Answers
I need a help with the score system in my game. Any help will be greatly appreciated. 1 Answer