How to make a sprite flash different colors?

Hi all. I’m trying to make a 2D memory game, but I’m VERY rusty with my programming. I’m having a little trouble getting started – I currently have a sprite of a computer and then four buttons underneath it (red green blue yellow.)

I want the computer screen (of the sprite) to flash one of the four colors (one at a time) until it completes a sequence. For example, computer flashes “red, then blue, blue, green, blue, red”, then the user would have to click the buttons and input the same sequence. I am not sure how to make the sprite change colors like that, and I’m not sure how to check to see if the user’s input was right.

Any help is greatly appreciated, I have no code as of now lol. Thanks!

You’ve got two main options.

  1. Create a button sprite of each colour and swap them out when required

  2. Create a white sprite for the buttons, and use GetComponent().color to set the colour as required