Display the added random score

Hello everybody,

When the player hits an asteroid in my game, there will be points added to his score.

What I use is:

This all works perfectly well.

What I want to achieve is when the player hits the asteroid, the random amount of points gained is displayed at the position where the asteroid was hit.

How can I do this?

What I have been playing with so far is this:

But how can I make sure it displays the random score it produced moments ago?

I hope my question is clear. Thanks in advance for your help.

You could create a separate “random” variable, add that variable to the score. And display that variable’s random number every time it changes. Here’s an example which uses left mouse click to add the score. It does +1 to the score, then adds the random variable (which I named Rand). And displays each of the numbers (the final score and the value of the randomly generated number) in separate texts called “Score” and “Random”…

1 Like

Man, thanks, it works.

How come I didn’t think of this? :smiley:

1 Like