Forum Discussion

SusanJaques's avatar
SusanJaques
Community Member
3 years ago

Trying to make a trigger so that pressing a key changes the layer, but it isn't working right.

Hello,

I'm trying to trigger a new layer to show up when someone hits the left or right key after typing into an text input box.

After taking a look at some of the other similar questions on the forum, I created a variable for each layer, and then tied key presses to the state of the variable. However, it is only partly working- it will go forward through all the layers, but it won't go backwards.

If I had to guess, I'd assume that the way I get the variable to change based on the layer the slide is on is probably done poorly. Currently,  I've got it set up so when the state of one of the text boxes on the layer in question is normal, then it sets the variable to the number associated with that layer. Surely there's a better way?

  • Ron_Katz's avatar
    Ron_Katz
    Community Member

    Hi Susan,

    It looks like you were making things a little more complicated than you needed to.  I deleted your variable reference as Storyline can manage this fine without it.

    Set your base layer properties like this.

    Set your layer properties like this

    Then just let storyline do the work.

    Updated file attached.

    • SusanJaques's avatar
      SusanJaques
      Community Member

      You, sir, are a gentleman AND a scholar. Thank you so much! It's sometimes so difficult to figure out the best path forward when there seem to be so many possible ways of making it work.