Forum Discussion
Toggle between custom states
Hi,
I would like an object to toggle between normal and a custom state. It looks like I can only use the toggle trigger with a Disabled or Hidden state... and the same when setting up a true/false variable. I feel like I am missing something...
Any help is greatly appreciated!
- WaltHamiltonSuper Hero
If all you want is a toggle between two states when the learner clicks, use Normal and Selected. They have built-in superpowers to toggle back and forth.
If your need to toggle at some other impetus, you will need a custom state, a T/F variable, and some triggers:
1. Change to state if variable = T
2. Change to other state if variable = F
3. Toggle (not set) variable.
- AbbyWalden-c5d2Community Member
Thank you, Walt. The problem I see is that when I set the T/F variable, I am not able to select the custom state to between.
- AbbyWalden-c5d2Community Member
*to toggle between.
I want to toggle between Normal and Custom state.
- PhilMayorSuper Hero
The toggle trigger is only for disabled and hidden which I have always found odd but is how it works.
Walt is suggesting using a selected state which is the most elegant way to toggle a state.
His other solution which will work well is to create the triggers in the order he suggest then it will work
- AbbyWalden-c5d2Community Member
Maybe I am asking the wrong question.... I want an object to toggle between states without interaction from the user. Is this toggle or maybe motion paths off to the side that trigger state changes?
- PhilMayorSuper Hero
What triggers the state change?
Sent from my iPhone
- AbbyWalden-c5d2Community Member
Animation beginning and ending on two different motion paths?
- PhilMayorSuper Hero
There is a trigger when animation complete which you can use to build a state change. For the animation start can you use when timeline starts for the object? Or the trigger that starts the animation.
Sent from my iPhone
- AbbyWalden-c5d2Community Member
Got it. Begin motion path1 when the timeline starts on the slide.
Change state 1 to state 2 when motion path 1 completes
Change state 2 to state1 when motions path 2 completes.
Move motion path 2 once motion path 1completes.