Goal collider

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:

  1. With BoxballGame selected in Hierarchy, create a new 3D Cube, named GoalCollider.
  2. Set its Transform Position to (0, 2.5, 0) and Scale (1.8, 0.05, 1.8).
  3. On its Box Collider component, check the Is Trigger checkbox.
  4. Remove its Mesh Renderer component (gear-icon | Remove Component).
  5. The following screenshot shows the scene with GoalCollider before its renderer is removed:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset