Spawn and rotation

arvanitisarvanitis Member Posts: 26
edited November -1 in Working with GS (Mac)
Hello. I have 1 actor of 32x32. I want when begin the scene to spawn 3 same actors with randomly in 0 degrees rotation or 90 degrees rotation, and the degree they are to be constarined in an attribute named ROT. Can anyone help?

Thank you

Comments

  • arvanitisarvanitis Member Posts: 26
    arvanitis said:
    Hello. I have 1 actor of 32x32. I want when begin the scene to spawn 3 same actors with randomly in 0 degrees rotation or 90 degrees rotation the one at the top of the other, and the degree they are to be constarined in an attribute named ROT. Can anyone help?

    Thank you

  • PhoticsPhotics Member Posts: 4,172
    arvanitis said:
    Hello. I have 1 actor of 32x32. I want when begin the scene to spawn 3 same actors with randomly in 0 degrees rotation or 90 degrees rotation, and the degree they are to be constarined in an attribute named ROT. Can anyone help?

    Thank you

    random(game.ROT-45,game.ROT+45)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You could put a self integer attribute in the actor we'll call it rotationselect.

    At the begining you your actor you would have a change attribute behavior

    Change attribute self.rotationselect to Random(1,2)

    Then a rule

    If self.rotationselect = 1
    --Change self.rotation to 90
    Otherwise
    --Change self.rotation to 0
  • arvanitisarvanitis Member Posts: 26
    Thanks for your immediate responses on rotation. Works perfectly. Now I just want when the scene starts, to spawn 3 times the same actor the one at the top of the others....
Sign In or Register to comment.