Skip to main content

Scroll View 2D In Only 1 Direction

Answered

Comments

1 comment

  • Jason Stanczyk

    Good Day Mason, 
    I will additionally follow up in a private message on this. 

    A simple way to achieve this is to use "Node Components" and use triggers with custom conditions. 
    You can add a temp value to the container node. This we will use as a delay identifier. 
    On the scroll View 2D, create a trigger for "On Property Change" with an action that sets the temp value on your container node with the Y position of the scroll position. The key point is to set it on a few milisecond delay. This will provide to you a number that the scroll position was at just a few frames ago.
    Then you compare that temp value to the real value of the scroll position. 
    Now that you have a comparison you can decide the behavior if the value is smaller, or if it is larger. Perhaps, if smaller the container closes, and that can be a state manager state, and if larger then it opens the container. 

    I hope this helps. 

    1

Please sign in to leave a comment.