Random Event issues

Hello. I’m having an issue with a random event that I’m attempting to create. What I’m trying to go for is when an enemy is struck X number of times, a game object appears (Which is basically a hit noise, pow, etc.) for a very short duration and then disappears. The other part to this is that I’m attempting to try to cycle through the game objects as I have 5 of them that I’d like to randomly appear. Any ideas on how to go about doing this?

I have the objects already created, I have hits already taking place based around triggers, I’m just not sure where I’d go about applying this or even how for that matter.

The super simple way I’d do it, is by creating some type of array, or list, then randomly grabbing an element from that list. Here’s a c# example I had laying around.

public GameObject[] someObjects;
GameObject PickAnObject(){
	int randomNumber = Random.Range(0, someObjects.Length);
	return someObjects[randomNumber];
}

It’s implied that you manually fill the array someObjects yourself.

Thank you very much! I wasn’t sure how to approach that initially as it’s been a while since I’ve coded haha.