Now we have an invisible collision box waiting for something to hit it. Unfortunately, without a script to tell it how to respond, it will do nothing when it is triggered. Let's fix that by following these steps:
- In the Inspector, click on Add Component near the bottom of the Component:
- Name the New Script ScorePoints:
- Double-click on the faded ScorePoints in the ScorePoints component. This will load up Visual Studio:
- Once Visual Studio loads, type in the following script. This is a very simple script:
- Let's go ...