Need Help with Rule.
Qorrel
Member Posts: 22
Hi, im trying to make a button that alternates between two integers when pressed. I have made one that should work but it doesn't, as in it works to change a variable one way but not the other. The Code so far.
-Group; (
Rule- Attribute. game.Thing. = 1
-Rule. Attribute. Angle = 270
--Rule actor on pressed - change attribute to 90
Rule- Attribute. game.Thing. = 1
-Rule. Attribute. Angle = 90
--Rule actor on pressed - change atrribute to 270
)
The only way i can get it to work is if i do it so it only stays if i make it at 270 so long as i press it.
Any suggestions?
-(oh, i changed the name of the attributes as its my key mechanic)
-Group; (
Rule- Attribute. game.Thing. = 1
-Rule. Attribute. Angle = 270
--Rule actor on pressed - change attribute to 90
Rule- Attribute. game.Thing. = 1
-Rule. Attribute. Angle = 90
--Rule actor on pressed - change atrribute to 270
)
The only way i can get it to work is if i do it so it only stays if i make it at 270 so long as i press it.
Any suggestions?
-(oh, i changed the name of the attributes as its my key mechanic)
Comments
change attribute: game.toggle to 1-game.toggle
and then test for game.toggle = 0 or 1 and change your other attributes accordingly.
I think i am doing that. From what i understand i am doing. I am changing the atrribute so long as the other one is on. But for some reason that does'nt work if i have the two toggles on the touch's on "inside". When i give it on pressed and released then it works.
[Rule] when touch is pressed
--[Rule] when self.Attribute = 270
--changeAttribute self.Attribute = 90
Otherwise
--[Rule] when self.Attribute = 90
--changeAttribute self.Attribute = 270
MH