To detect a goal, we will add a 3D Cube game object with a collider to the basket. It will only be an invisible collider, that is, not rendered as part of the scene. We want collisions to trigger events, which we'll handle in a script:
- With BoxballGame selected in Hierarchy, create a new 3D Cube, named GoalCollider.
- Set its Transform Position to (0, 2.5, 0) and Scale (1.8, 0.05, 1.8).
- On its Box Collider component, check the Is Trigger checkbox.
- Remove its Mesh Renderer component (gear-icon | Remove Component).
- The following screenshot shows the scene with GoalCollider before its renderer is removed: