Randomly Changing Color of Spawned Actor

jdgouldjdgould Member, PRO Posts: 114
edited June 2012 in Working with GS (Mac)
I need a little help automatically changing the color of a spawned actor. Say I select 1 of 3 items and every time I touch on the screen (background actor) I want to spawn the actor I selected from the 1 of 3. But in addition to spawning the actor, I also want to randomly change the color of the spawned actor. Is that possible?

I have the first part working, I just need the color of the actor to change randomly when spawned.

For example, when a circle is selected I have a game attribute that says circle = 1. On the background scene I have a rule that says when touch is pressed, and game attribute = 1 spawn circle. Now I want the color of the spawned circle to be a different color other than red when spawned.

Thanks,
Jeff

Best Answer

  • kinzuakinzua Posts: 554
    Accepted Answer
    Use the self.color attribute to control colors.. u'll have to change the RGB.. won't b much of a issue..

Answers

  • jdgouldjdgould Member, PRO Posts: 114
    So I do that in the actual actor that is spawned not a separate actor I have on the scene in the background correct. For example, I would open the Circle Actor and create a rule that says when game attribute = to circle change attribute self to color red random (0,1) etc...?
Sign In or Register to comment.