Random colors for game(SOLVED!)

I want to make a block that will randomly choose 1 of each of these colors:

  • Red
  • Green
  • Blue
    I tried this code:
    Screenshot 2023-04-27 8.39.15 AM
    But the blocks just became black and didn’t get randomized in color.
    Can someone help please?

routers, and make sure you have numbers to set the RGB’s

2 Likes

So those color values are on a scale of 0-anything, you were inputting 1-3 into ALL of the inputs. (Starting color is 100,100,100)

To change the color you can do 2 things

  1. Create a Red, Green, Blue animation and do what you did, except connect the Random to the “Go To” input (on the Animation behavior)
  2. Input 100, but into only 1 input while the other 2 are set to 0. Do this for each color.
    (Make sure the object is pure white if you do option 2, if you had a blue square and tried setting red to 100 and blue/green to 0 it wouldn’t really work)
2 Likes

Oh! thanks CodeAlpaca and Hong_Jooni_Pooni!

3 Likes