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:
" + 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