why isnt this attribute working?

idoistuffidoistuff Member Posts: 197
edited November -1 in Working with GS (Mac)
I want to make it so no more then 5 "balls" can be on the scene.

I made an attribute integer with the value of one.

then I put this code in my "safe area" actor.

http://dl.dropbox.com/u/11172522/gs.png

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you see where it says all conditions are valid? that means all of those rules have to be active for the event to happen.

    So the way you have that set up if touched is pressed AND attribute = 1 AND attribute =5 spawn ball. So its only set up to spawn when that attribut =1. THis is how you want to set it up. First delete all your rules and behaviors from that actor and start fresh with this.

    Have your rule when touch is pressed and when attribute < 5
    then for the behaviors have a change attriube behavior changing the attribute to attribute+1 and have a spawn actor behavior under it.

    So everytime you touch it spawns a ball, and changes that attribute +1 to let you know that a balls been added. And since you have <5 onces theres five balls on the scene(the attribute will equal 5) it wont spawn anymore

    Cheers
  • idoistuffidoistuff Member Posts: 197
    thanks guys! it worked and I learned something new :)
Sign In or Register to comment.