Supporting our Community:
We’re making Learn Premium available to all users in perpetuity.
Start Learning.

Challenge 2 - Play Fetch

1 Hour
For Educators
Tutorial Materials
Challenge Overview:
Use your array and random number generation skills to program this challenge where balls are randomly falling from the sky and you have to send your dog out to catch them before they hit the ground. To complete this challenge, you will have to make sure your variables are assigned properly, your if-statements are programmed correctly, your collisions are being detected perfectly, and that objects are being generated randomly.
Challenge Outcome:
  • A random ball (of 3) is generated at a random x position above the screen
  • When the user presses spacebar, a dog is spawned and runs to catch the ball
  • If the dog collides with the ball, the ball is destroyed
  • If the ball hits the ground, a “Game Over” debug message is displayed
  • The dogs and balls are removed from the scene when they leave the screen
Select your Unity version
Last updated: July 23, 2020
Topics we'll cover
Challenge 2 - Play Fetch
Challenge 2 - Play Fetch