Press button, move actor on top of button. Press again move actor back.

powkiepowkie Member Posts: 63
edited May 2012 in Working with GS (Mac)
Hey everyone,

Would appreciate if anyone could help me out with this annoying thing I'm stuck on.

Example:

I have a button and one actor that will move on top of the button when it's pressed and when pressed again the actor will move back to it's original place.

So this is how i did it (keep in mind that the actor has a transparent to 30%):

In the button: Attribute is 0, when pressed change attribute from 0 to 1

In actor: When attribute is 1, self.position.x xxxx self.position.y xxxx

In the button again: Attribute is 1, when pressed change attribute from 1 to 0.

In actor: When attribute is 0 self.position.x xxxx self.position.y xxxx (from it's original place).

The thing is i can get the actor to end up on top of the button but when i press the button again the actor won't move back.

Thanks!

BR

Powkie

Answers

Sign In or Register to comment.