Forum Discussion

SeanPowell's avatar
SeanPowell
Community Member
4 years ago

Trigger for an increase or decrease in a variable question.

I am looking for a way to do this....

 

I have an object on a screen that I want to have 2 motion paths hooked to. One path for when a variable gets bigger and the other for when the variable gets smaller. This variable is hooked to a dial.

So when the dial goes up I want the object to go up incrementally and vice versa for when it goes down. 

So I assume the triggers would look something like this

"move object along path x when variable increases"  

"move object along path y when variable decreases"

But I can't figure out how to get the statements written in storylines templates.

 

Anyone have any ideas?

 

PS I can't use states because I will have multi directional triggers by the end and that will end up being thousands of states and even more triggers to join them all.

 

 

2 Replies

  • Hi, Sean. 

    I'm looking forward to the suggestions you will receive from the community!

    One suggestion would be to create a temporary variable that will receive the value of the Dial to compare which one is higher. I tested this with a couple of motion paths with relative starting points:Windows 10 (1) 2021-12-08 at 1.51.05 PM

    • Assign TempVariable = Dial1 when the timeline starts.
    • Move the rectangle to the right when Dial1 > TempVariable (Dial moved to the right, so rectangle moves to the right)
    • Move the rectangle to the left when Dial1 < TempVariable (Dial goes left, and so does the rectangle)
    • Once the movement finishes in either direction, TempVariable updates its value, so it equals Dial1 (Set TempVariable to variable Dial1 when the animation completes). 

    This is what it would look like:

    Screen Recording 2021-12-08 at 01.58.19 PM

    I hope this helps!