Make Unity know which target was hit first.

Ok, I’m stuck here.

I’m making a shooting range mini-game. I have a machine with 4 targets with numbers on them. I randomly generate the order of the numbers 1-4 and have the player shoot the targets in the order that I generate. (Make sense?)

What I need is a way to figure out in what order the player shoots the targets. I need to know which target he hit first, which target he hit second, etc. If there was a way I could make parameters I could send to another function that would tell the function what target was hit, and in which order it was hit, that’d be great. I just have no idea where to start.

Thanks ahead of time!!!

I assume that you want to check the order. A simple approach would be to give them identifying names i.e. “1”, “2”, “3” & “4”. Then add them to a collected string on hit, and in the end check if the collected string is “1234”.
It’s not the most optimal approach, but it should do the trick if I understood your issue correctly.