Begin building the game assets in Hierarchy. Under ImageTarget create a root object for our game named ThrowingGame and then we'll create ball game graphics under that:
- In Hierarchy with ImageTarget selected, create a child empty game object (Create | Create Empty), name it ThrowingGame.
- Reset its transform if necessary (Transform | gear-icon | Reset) (as you should any time you create an object in a scene so we start with a clean transform).
- With ThrowingGame selected, create an empty game object and name it BoxballGame.
- We're going to put the floor and goal into a Court parent object.
- In Hierarchy, with BoxballGame selected, create an empty object and name it Court.
For the floor plane, make a Unity 3D plane. Recall that Unity Plane objects are default 10 x 10 units, which we'll use as our default court scale also.
- In Hierarchy, with Court selected, create a 3D plane (3D Object | Plane) and name it Floor.
- In the Project Assets/ARPlayBall/Materials folder, create a new Material (right-click | Material) and name it BoxballFloorMaterial.
- Set its Albedo color to something interesting (we picked a purple #7619FFFF).
- Drag the new material onto the Boxball/Floor.
For the goal, as its name implies, we will make a simple box with a matt-like finish, as follows:
- In Hierarchy, create an empty object as a child of Court, name it Goal.
- As a child of Goal, create a 3D Cube, set Scale (2.2, 0.2, 0.2) and Position (0, 1.5, 1).
- Duplicate the Cube three times and set their transforms as follows:
- Position: (0, 1.5, -1), Rotation: (0, 0, 0)
- Position: (1, 1.5, 0) Rotation: (0, 90, 0)
- Position: (-1, 1.5, 0), Rotation: (0, 90, 0)
- In the Project Assets/ARPlayBall/Materials folder, create a new Material, named BoxballGoalMaterial.
- Set its Albedo color to something interesting; we picked a green # 0AAB18FF, and adjusted Metalic: 0.5 and Smoothness: 0.1.
- Drag the new material onto each of the Goal cubes we just created.
Lastly, for the ball, let's make it look like a metallic pinball:
- In Hierarchy, with BoxballGame selected, create a 3D Sphere and name it Ball.
- Set its Scale to (0.75, 0.75, 0.75) and Position to (0, 3, 0).
- Create a new material named BoxballBallMaterial".
- Set its Albedo to # BABABAFF, Metalic: 0.8, and Smoothness: 0.8.
- Drag the new material onto the ball.
The scene Hierarchy should now contain the following:
Save the scene. The resulting scene should look something like the following:
Press Play and point your camera at your image target. The game court should appear but it might be excessively over scale.