- Home /
Can´t Get My Score System To Work. Help!
I am building a game where you fly a plane and when you click with your mouse you drop a bomb. The goal is to hit the moving troops on the ground. I have managed to make the collision work so both the bomb and the troops vanishes(using the function Destroy(). But I want to add 1+ to my score each time I hit a troop. But it wont work properly.
Here is a screen of the code I use.
I have tried all kinds of score +1 and making several variables to add to the total score but nothing works. I bet this is really simple, but I am a newbie to this.
When I have the score working I am going to use a PlayersPref to store the score.
Do someone have a solution to my question?
add a Debug.Log line after you increase the score so you can see what's happening.
Debug.Log(" The Score now equals " + score);
and if only adding 1 point at a time then
score ++;
should work fine. EDIT (not that += 1 is wrong just saves you 2 characters)
Your answer
Follow this Question
Related Questions
Object falling over triggers way too many times 0 Answers
Simple score system breaking crates 1 Answer
Pause Time.time? 1 Answer
How to save score for survival time? 1 Answer