Forum Discussion
- RebeccaFleischCCommunity Member
Hi John and Michael,
I thought this might be doable without variables, and turns out it is (at least, I think it's working as you'd described, John). Either way is correct, of course...but figured I'd throw it up here.
The particulars:
Initial state (normal state) is blue.
Then I created a state for red, green, orange, and blue
You'll see how the triggers work if you look at the triggers panel...trigger order is important.
Please shout out with any questions.
- MichaelHinzeCommunity Member
See attached a quick example that cycles an object through four different colors/states based on the value of a counter variable. Hope that helps.
- JohnHancockCommunity Member
Thta helps.
Thanks
- MeryemMCommunity Member
Rebecca, that is brilliant. So simple, but what a puzzle to get the trigger order right!
- JohnHancockCommunity Member
Thanks. That works as well. Just out of curiosity how did you know what order?
- RebeccaFleischCCommunity Member
Tx, Mereym!
To tell the truth, John, I fiddled a little. I had them all but one.
I knew that, according to Articulate support,
If there are multiple triggers on the same object that are triggered by the same action (such as "on click"), the triggers execute in the same order in which they appear in the Triggers panel (top to bottom).
And that SL "looks" down the list and keeps going until it finds a trigger that it can use (you can tell by my description that I'm not a programmer ).
So a sort of "reverse order" seemed to work here...
- ElearnWagggsCommunity Member
Hi Elearn! Thanks for popping in to share. As you can see from the documentation here, triggers execute from top to bottom.
- GeorgeTuftCommunity Member
Hi all...
I have a similar issue.
I'm trying to change the state of a character back and forth upon clicking the character.
I've uploaded a sample.I've tried re-ordering my triggers. One order allows me to change from normal to angry, but not back to Normal. The other order does nothing. :(
I downloaded Rebecca's file, and what I've built looks similar...but I can't seem to get the states to bounce back and forth.
Can someone have a look and suggest a change?
Thanks!
-gt
- WendyFarmerSuper Hero
Hi George
I've added a varaible that toggles - see if this works for you
- WaltHamiltonSuper Hero
If you use only current state to determine whether to change or not, the character will always change to the last trigger's state.
You need an independent, outside, impartial observer (like Wendy's variable) to declare what state to change.
If you change based on the current state, the state will change twice. Notice that the variable only changes once, without the need for a condition, so it is reliable.