
Augmented Reality for Developers
By :

We can now start building our game mechanics. The first step will be a script to throw the ball. The plan is that, when a new shot is available, the ball will appear at the bottom of your screen. The user taps and flicks the ball on the screen to throw it. This launches the ball into the 3D space and we will detect if the ball collided with the basket goal for a score. The stages of game play are:
We will track the launch speed and direction of the throw as well as other properties that let us adjust characteristics of the ball and its throw.
To begin, in your Project Assets/ARPlayBall/Scripts
folder create, a new C# script named ThrowControl
and open it for editing. First, we'll write the following code that resets the ball to its ready state:
File: ThrowControl.cs
using UnityEngine...