Detecting goals

OK, we can throw the ball. Now, we need to detect if you got a goal and keep score. To detect a goal, we will add a Collider to the goal and handle any collision events from the ball. When you make a goal, you should be congratulated with audio and visual feedback and the points added to your score. First, let's detect whether you've made a goal. In the next section, we'll tackle keeping score.

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.