As we envisioned it, we would not tell the player during the playing whether their selection of objects was correct or not, but rather when the player enters the ending room, the corresponding ending sound design would be played according to the number of correct objects selected by the player. With a lot of study and help from our tutor and friends, this is how we implemented this logic:
- mark all selectable objects into correct and incorrect.
With this script, we only need to tick off the correct objects.


- Calculate the score after the player completes the selection. For each correct object selected, the recorded data is increased by 1. This step is refined directly in the selection script.



3. Based on the player’s total score, five carrier objects that play the ending sound design are set up, corresponding to scores 0 ~ 5. In this result script, only the object corresponding to that score will be visible, the other four will be hidden. Drag the corresponding object into the box can simply complete the setting.


So when the player finally enters the ending room, they will only see the corresponding sphere and hear one of the sound designs.


