Find multiple identical items in an array
Hi, so Im working on setting materials from items in an array. It checks to see if a number is in the array and if so set the material based on the index. The issue I have is when the random "Code Answer" (Between 0000-9999) contains multiple of the same numbers e.g. 7783 the 2nd duplicate number does not set a material which makes sense. I'm struggling to come up with an efficient solution (other than using 4 branches each time) whereby I can assign the next index to a different material.