COIN GAME
In the previous lessons, we have learned how to add, move, and rotate an object in Unity. We will now apply these concepts to create a simple game; COIN COUNTER GAME. We need to import assets such as a ball (player), coin, robber (antagonist/challenge). After import, place the assets as shown. Note that the robber's initial position must be out of the main scene. ADDING SCORE TEXT We want to display the players score in the game. In order to do that, we go to the Scene Panel , right click, select UI , and finally select Text . A scene will be created named Canvas. Click Text under it, and from the Inspector Panel, write Score: as the text. Also, align the text in the upper center position of the canvas. ADDING COMPONENTS FOR EACH ASSET For the Score Text, we will add a script component containing the following code: Make sure to add UnityEngine.UI library in your code since we are using a UI Component in the scene. For the ball, we will add a script component for...