Forum Discussion
Maximum call stack size exceeded
Hi Daan,
Storyline lets you apply multiple triggers to the same object. If there are multiple triggers on the same object that are triggered by the same action (such as "when the timeline starts"), the triggers execute in the same order in which they appear in the Triggers panel (top to bottom). What you’re describing is a conflict between simultaneous triggers, where two or more triggers attempt to modify the same object's state at the same time, potentially leading to erratic and unexpected behavior and in extreme cases, it might overload the underlying JavaScript engine (hence the stack size error). There are few ways to resolve this:
- Prioritize Triggers
- Determine which trigger should take precedence when both conditions are met.
- Reorder the triggers in the Triggers Panel so the higher-priority trigger appears first.
- Add Conditional Logic
- Modify the conditions to ensure only one trigger executes at a time.
- For example:
- Trigger A: Change state of an object to "Hidden" if Var1 = true AND Var2 = false.
- Trigger B: Change state of an object to "New State" if Var2 = true AND Var1 = false.
- Use a Mediating Variable
- Introduce a new variable to act as a "tie-breaker" for conflicting conditions.
I'm not exactly sure what you're trying to accomplish in your example, but you did a good job reordering the triggers to manage the stack size error. Let me know if you need further assistance in refining the triggers to achieve the desired outcome.
- DaanGroen10 months agoCommunity Member
Thank you for the feedback. Already very insightful.
I didn't realize triggers where executed based on priority. I assumed the top trigger would be executed first and then the other triggers would follow from top to bottom. So with 2 state triggers on the same object i assumed the top trigger would be executed first (setting a certain state) and then the second trigger would be executed, setting a different state.
But it looks like it keeps bouncing between the two triggers, creating this stack size error.
I'm also confused why the problem occurs when i start the triggers at object start on timeline, but not when both triggers occur at the start of the timeline.
Related Content
- 31 days ago
- 2 months ago
- 24 days ago