so i try For 1,2,3,2,1,2,3,2,1 you can try: abs(mod( self.Time ,4)-2)+1 but it only go to 3 then 212121 and so on, i try to mess with the number but no luck.
i need this so i can touch a actor and change y position from 50, 100, 150, so i can have a rule like when attribute 'number" =2 change y position to 100, as you can see even if the actor is on 150 the "number" value is =3 so when i touch it the "number" is =2 now so it will move down.
@guilleface -- create an integer attribute called 'touchCount' and then:
Change Attribute: touchCount To: 2
Change Attribute: self.Position.Y To: 50*(abs(mod( self.touchCount ,4)-2)+1)
When mouse is down
--Change Attribute: touchCount To: touchCount + 1
--Change Attribute: self.Position.Y To: 50*(abs(mod( self.touchCount ,4)-2)+1)
Comments
@guilleface, in this thread I proudly presented a high brow approach, then @RThurman came along und unnecessarily simplified it
Your sollution is at the end of the thread.
http://forums.gamesalad.com/discussion/65863/how-can-i-have-an-attribute-loop-between-3-numbers
thank you i will take a look.
so i try For 1,2,3,2,1,2,3,2,1 you can try: abs(mod( self.Time ,4)-2)+1 but it only go to 3 then 212121 and so on, i try to mess with the number but no luck.
i need this so i can touch a actor and change y position from 50, 100, 150, so i can have a rule like when attribute 'number" =2 change y position to 100, as you can see even if the actor is on 150 the "number" value is =3 so when i touch it the "number" is =2 now so it will move down.
@Hopscotch -- lol 'unnecessary simplification'!
@guilleface -- create an integer attribute called 'touchCount' and then:
when touch is pressed
attribute = ((attribute+1)%3)+1
edit, misread your original question. sorry!