Change Attribute - simple question!?

DigiChainDigiChain Member, PRO Posts: 1,288
edited November -1 in Working with GS (Mac)
I seem to keep having small problems like this so wonder what I am doing wrong. This is a very simple example that isn't working for me - why?

I have created a text attribute (called direction) and it contains the word UP.

I have an actor and have created 2 rules:

RULE> When actor receives touch & text attribute is UP
Change text attribute to DOWN

RULE> When actor receives touch and text attribute is DOWN
Change text attribute to UP

It doesn't work. If I remove one of the rules it will work - but doesn't with both rules there. Do they somehow conflict - and if so how do i sort it out? I just want to be able to touch the actor to alternate the text attribute between Up and DOWN.

Comments

  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    It wont work because the actor will recognise the touches in the rules as a unique touch. Therefore it wont work. I can't remember how i solved this issue...
    uhm...
    try this:

    ------
    RULE> When actor receives touch & text attribute is UP
    timer after 0.1 sec
    Change text attribute to DOWN

    RULE> When actor receives touch and text attribute is DOWN
    timer after 0.1 sec
    Change text attribute to UP
    ------

    I'm sure there is a better way to solve it, I just like to use this one ;)
  • DigiChainDigiChain Member, PRO Posts: 1,288
    Thanks. I've been going mad with this one! Just couldn't understand why it didn't work - but that helps a lot, cheers.
Sign In or Register to comment.