How can I make collectibles have to be picked up in a certain order?

I’m working on my first game. I’m trying to make an educational game for kids and toddlers about the ABC’s, colors, and shapes. I want to make the collectibles/letters only be able to get picked up in a certain order. Please help. Thanks in advance. :smiley:

This can be done in many different ways however the best one is probably assign some index to your collectibles which will define the order. So lets say you do a script with one public variable called index so you can set it from the inspector. Then you assign it to you collectibles, so for example A gets index 0, B gets 1, C gets 2 etc. And then you put another script to you player/controller which will have an int variable called something like lastIndex and its default value will be 0. Every time your player/controller tries to collect something you ask if the index of an object you collided with is equal to your lastIndex variable + 1. If it is, then you can collect it and add 1 to your lastIndex variable.