Randomly change color of object

heres an example that shows a bit more on how to implement what your asking about. mainly the part between the get node and the branch is what id highlight here. what that part does is the testing to see if the cube has already been changed to the secondary material (aka the bad one in game). if it has been changed then it triggers game over, if not then it sets the material. its a simple basic test. i wrote this in the level bp but in your case you probably want to writing your script in the game mode.