Random Behaviour

ForteForte Member, PRO Posts: 297
edited November -1 in Working with GS (Mac)
Hello,

I may have asked this question before, but I have failed to locate it in the forums.

How do i make the actor chose between two things?

So it could be a random choice.

The reason is that i am trying to make a machine gun, and i want it to spray and not go in one direction.

Cheers, Dragokillz

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    make a new integer attribute in the machine gun actor called myRandomDirection or something like that.

    Then have a Change Attribute like this:
    myRandomDirection = random(0,1)

    Then two rules:

    When myRandomDirection = 0
    Do something

    When myRandomDirection = 1
    Do something
  • ForteForte Member, PRO Posts: 297
    a ha! cool thanks!
Sign In or Register to comment.