When bounding boxes collide
So, we have accomplished the organization and simple importing processes. That wasn't much of a challenge, was it? Well, now it is time for something with a little more substance.
In this section, we will build seven trigger colliders so that our application will register a score when they are hit by the balls. We will then write a simple script that tells the application manager to change the score based on the trigger that was hit.
To start, we need somewhere to put our collection of collider boxes. As we did with UI and Static Lights earlier in the chapter, create an empty child object of skee
, called TargetColliders
.
Note
The Mesh Renderer of a Unity GameObject is what determines the visibility of that object. It stores the materials and lighting information. In my experience, I have found that building an actual mesh object and then removing or turning off the Mesh Renderer produces better results in terms of collisions.
The scoring system in our game will be...