Tile floor with random tiles changing colors for a few seconds

Dear experts,

I have a tile floor and I want to change the color of single tiles randomly for a few seconds.
This function gets all my tiles laid out and randomly picks one and then changes the material:

I am calling this with a delay in tick:

It works but then the tile color does not change back to its original color. I would like to change the color back to its original after 2 seconds.
Any ideas please are really appreciated, thank you.
Peter

You have to call ‘set material’ again, but with the original material.

BTW: delay on tick does nothing, it’s basically ignored. Tick runs EVERY FRAME, I’m sure you don’t want to change tile colors every frame.

Better to use a timer.

thank you. But somehow it does flip tile colors every 4 seconds. How would I use a timer on this? It basically has to start with begin play and then just keep running and flip tile colors every few seconds. I have never used a timer…

Just

image

If you only want one to go, use:

followed by

1 Like

thank you very much, the second option works for me!

1 Like