Setting up the scene with ball games

Let's add the new ball games to the scene and add the components they need, which we wrote in this chapter.

For each prefab basketball, football, and paperball:

  1. From the Project Assets/BallGameArt/Prefabs folder, drag the prefab into the Hierarchy as a child of ThrowingGame.
  2. On the ball game object itself, add the BallGame script as a component.
  3. On its ball object, add the ThrowControl script.
  4. On its goal object, add the CollisionBehavior script.
  5. Add to the OnCollision() list, drag the GoalCanvas to the Object slot and set the GameObject.SetActive function, and then check the checkbox.
  6. On the GoalCanvas, add the TimedDisable script.
  7. On the GoalCanvas, add an AudioSource component, drag the Cheer sound ...

Get Augmented Reality for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.