Forum Discussion

JosCabrera's avatar
JosCabrera
Community Member
8 hours ago

Setting a maximum value for a number variable

Hello,

I am using Articulate Storyline 360, and I am trying to use a condition in a trigger to set a maximum value for a number variable.

My trigger says,

Add value 1 to S1D2_End_Counter

When the timeline starts on this layer

if S1D2_End_Counter < value 5

I expected that the value of S1D2_End_Counter would stop at 4. However, 1 will continue to be added to variable past 5.

I imagine there is another way to do this or perhaps there is an error in how I set up my trigger.

I would appreciate learning your thoughts about this issue.

-José

  • Hi JosCabrera, your logic looks correct, and the variable should only reach a value of 5. Check your variables window, and check the usage of S1D2 and ensure the variable is not being used elsewhere in the project. From the logic you have shown, it should reach 5 and not pass 5.

    I don't suppose you are able to share your Storyline file (stripped down just to demonstrate the issue). Also, just make sure you are up to date on your version.