I have a JS that is waiting so that a condition is met while users are playing with the interactive animation.
The users may click some buttons that will trigger some actions. But if they click a series of buttons, then a function will make a logo appear.
It turns out that because a button triggers an action, the JS loaded with the scene that I wanted to monitor the situation (and is triggered once a condition is met) becomes not active anymore.
Trying to solve the problem, in each button's function we added a call to the monitoring function but it does not work.
So what we did is that for EACH button of the scene, we added a second function and it's the monitoring function. That way, when people are clicking on buttons, each time the monitoring function is loaded.
Is there a way to have a JS being active all the time, not forcing us to add this monitoring function for each button?