Since all the asset we made up until now can get destroy at some point (astroid get destroy when hit by bullet, Player get destroy when hit by astroid) etc. we need to make a new "object" to store the scores information separately.
So I make an empty game object (which is pretty much an invisible object) and create new script for it and it will be our scores manager.
| Scene manager Script |
This code is pretty much telling the console to print the scores +1 every times bullet hit the astriod
Here is the result the console will tell us the scores every time we hit an enemy
No comments:
Post a Comment