Actor Random Colour Help!!???!!

rhysdaramborhysdarambo Member, PRO Posts: 33

Hi.
I have a spawner actor and a coin actor.
Every 2.87 seconds the spawner actor spawns a coin actor which moves across the screen horizontally.
How on earth do I change the color of each spawned coin to be random?

I have tried loads of different ways. But they all seem to change the color mid way thru on the screen and it is just messy.
Please help ASAP

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    Hi @rhysdarambo

    Here's one way: in the actor's Rules that's to be spawned (in the Inspector) add the following (after making a real attribute called Random):

    Change Attribute Random to (random(0,100))*0.01
    Change Attribute self.Color.Red to Random
    
    Change Attribute Random to (random(0,100))*0.01
    Change Attribute self.Color.Green to Random
    
    Change Attribute Random to (random(0,100))*0.01
    Change Attribute self.Color.Blue to Random
    

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.