Forum Discussion
2-condition trigger issue
- 5 hours ago
Have a look at the attached and see if that's what you wanted. I added a True/False variable that is toggled every time either the slider or dial is moved. The status of the fire extinguisher is changed every time this T/F variable changes (rather than the timer slider variable) IF the correct temperature and time is set.
It won't work if you set the Timer to 120 first and then set the Temperature to 450 degrees, because the fire extinguisher's state is evaluated only when the Timer variable changes, not when the Temperature variable changes.
To resolve this, add an additional trigger that changes the fire extinguisher's state to Normal when the Temperature (dial) changes, using the same conditions. This ensures the state is evaluated whenever either variable changes, regardless of the order in which the user adjusts them.
Current trigger:
Additional trigger:
If you're a fan of JavaScript, you can implement this interaction with a single trigger. Simply add an Execute JavaScript trigger that runs when the timeline starts:
const fireextinguisher = document.querySelector('[data-model-id="6mukAbVtlHP"]');
setInterval(() => {
const timer = getVar('Timer');
const temperature = getVar('temperature');
if (temperature === 450 && timer === 120) {
fireextinguisher.classList.remove('hidden');
} else {
fireextinguisher.classList.add('hidden');
}
}, 100);
Both implementations are included in the attached Storyline project file.
Related Content
- 3 months ago
- 8 months ago
- 4 months ago