5.4 Adding Player Feedback

Player feedback is essential to guide, reward, and motivate players.

Types of Feedback:

  1. Visual Feedback: Changes in the game’s visuals based on player actions.
    • Example: A coin disappearing when collected.
  2. Audio Feedback: Sounds that reinforce actions.
    • Example: A “ding” sound when collecting items.
  3. UI Feedback: Notifications or animations on the user interface.
    • Example: A score counter increasing when a collectible is obtained.

Activity: Add a UI element to display the player’s score:

  1. Go to GameObject > UI > Text.
  2. Position the text on the screen (e.g., top-right corner).
  3. Update the text dynamically using a script:
public int score = 0;
public Text scoreText;

void Update() {
    scoreText.text = "Score: " + score;
}