why isnt this attribute working?
idoistuff
Member Posts: 197
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
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
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