Forum Discussion

dougofakkad's avatar
dougofakkad
Community Member
28 days ago

Variables on layers

I'm seeing some unexpected behaviour in Storyline 3.93.33359.

I want a button (or another hypothetical action) to show different layers based on a true/false variable -- in a simple example, if the variable is false, the button should show layer 1, or if true, layer 2.

I want this to happen in sequence, so after layer 1 has been shown, the button should show layer 2.

So I have a button on the base layer with these triggers:

And a trigger on layer 1 that sets the variable to True on timeline start:

Both layers are set to pause timeline of the base layer and prevent clicking on other layers.

What I would expect to happen is this sequence:

  1. User clicks button.
  2. Layer 1 is shown
  3. Variable is set to true
  4. User clicks button again
  5. Layer 2 is shown

Instead, layer 2 is shown on the first click.

I can't work out why this would be except if all these steps were being played at once. But you'd expect layer 1 timeline start to be necessary to show layer 2 on click, and layer 1 timeline won't start until after the button click.

I can't prove it as I am prevented by work policy from installing a previous version, but I think this was working differently in an earlier version as I implemented a few layers this way and didn't notice any issues until recently.

I've attached a Story file for reference.

  • Nedim's avatar
    Nedim
    Community Member

    The same outcome would have occurred in previous versions as well unless you changed the order of the triggers. What happens is that both layers will show at the same time—first Layer 1, then Layer 2. Once on Layer 2, Layer 1 will not be visible because the "Hide other layers" option is checked in both layers. To verify this, uncheck the "Hide other layers" option in both layer properties. Alternatively, you can adjust the "ViewLayer2" variable to True when the timeline reaches 0m 0.1s to achieve the expected behavior.