To display text to inform the user about the status of carrying a single object pickup, follow these steps:
- Start with a new copy of the Simple2Dgame_SpaceGirl mini-game.
- Add a UI Text object by going to GameObject | UI | Text. Rename it Text-carrying-star. Change its text to Carrying star: false.
- Import the provided Fonts folder into your project.
- In the Inspector window, set the font of Text-carrying-star to Xolonium-Bold, and set its color to yellow. Center the text horizontally and vertically, set Height to 50, and set Font Size to 32.
- Edit its Rect Transform and, while holding down Shift + Alt (to set its pivot and position), choose the top stretch box:

Figure 3.7 – Editing Rect Transform
Your text should now be positioned at the top of the Game panel, and its width should stretch to match that of the whole panel, as shown in Figure 3.6.
- Create the following C# script class called PlayerInventory...