Hints for the player
What if the player, less intrigued by the scattered power cells than the outpost door itself, goes up to the door and tries to enter? It may seem a little cold to simply switch on the empty power cell by itself—having the player character speak to the player will be a much friendlier approach to the gameplay experience.
At this stage it is also important to think about phrasing; while we could easily say Collect some power cells! it is much better in gameplay terms to provide hints by using inner monologue, by having the player character's thoughts relayed to the player, for example, "The door's generator seems to be low on power..."
To show the text on screen we will use Unity's GUI
Text component. There are various ways of displaying text on screen, but this is the simplest. We will go on to cover other methods, such as the Unity GUI
scripting
class later in this book.
Writing on screen with GUIText
Whenever you need to write text on the screen in 2D, the most straightforward...