Making a loop - pulling my hair out

Hi I'm trying to make a box in an elevator move up and down.

the box has 5 positions (called boxpos 1,2,3,4,5)

i'm trying to make a loop with a timer, so every 1 second it updates the attribute boxpos = boxpos + 1

each box then check if boxpos = 4 set alpha to 100.

thats working fine.

My problem is - i want my loop to change direction when boxpos = 5 then I want it to set boxpos = boxpos - 1 until boxpos = 0 then i should +1 again.

How do I do that? I have an attribute called boxDirection, but its not working?

Thanks for your help.
Anders

Comments

Sign In or Register to comment.