Randomly select 2 different numbers?

MonjiOMonjiO Member Posts: 20
edited November -1 in Working with GS (Mac)
So I know that the supported randomization feature chooses any value between two extremes, but is there a way to randomly select two different values?

So, for example, say I have an actor who, when it hits a trigger, moves up and down. But, I want it to randomly "decide" which direction to move in (the values 90 and 270 are what I'm using for changing direction). Can I set up something to choose between those two numbers? If so, how?

Comments

  • Fafnir312Fafnir312 Member Posts: 161
    Create an attribute "goUp" of type boolean and set it to true.
    Create a change attribute behavior: "direction" to "random(0,1)".
    Then create a rule that checks "direction" if "1" go up otherwise go down.
  • MonjiOMonjiO Member Posts: 20
    Excellent, thanks fafnir!

    Also most cool user name.
  • JGary321JGary321 Member Posts: 1,246
    Really?? I mean Fafnir312 is cool an all, but seriously.... I thought my name would be crowned as supreme. The name says it all!
  • Fafnir312Fafnir312 Member Posts: 161
    :P
Sign In or Register to comment.