I didn’t take me to long to get a working script, I am using a trigger to detect when the player (or ship) passes through it. I have attached this script to the portal looking beam as apposed to the whole checkpoint game object. When the trigger is activated the checkpoints Lights turn green, to signify the checkpoint has been triggered. The next checkpoints lights are set to yellow. The next checkpoint is manually specified in the inspector as a game object. The checkpoint sound is played once and the checkpoint counter is incremented. The trigger code looks like this:
You may notice the first condition is if the boolean isActive is true, this is what I use to check if a specific trigger is active. I am using this because I want to make sure that I can the checkpoints so that the players have to go through them in a specific order. The boolean variable is set to true on the checkpoint only if the lights on that specific checkpoints are yellow. Which as I mentioned before can only occur if the previous checkpoint has been triggered setting the next checkpoint to yellow.
