Announcement

Collapse
No announcement yet.

Detct Increases decreases value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Detct Increases decreases value

    Hi! How can i detect Increases decreases value. I need to create 2 custom events (1 - value is Increases and 2 - value is decreases) Help me pls

    #2
    [MENTION=807396]aekazmin[/MENTION]

    are you talking about conditionals: https://docs.unrealengine.com/latest...e/FlowControl/

    there are other nodes as well to test conditions, such as < <= > >= , as well as And & And/or there is even a compare node

    there is even math nodes: https://docs.unrealengine.com/latest...ath/index.html
    & even more here: https://docs.unrealengine.com/latest...ath/index.html
    (& you can even make your own)

    ** if I understand your problem you probably want to either use branch (if) conditionals nested together or maybe even you Compare Integer (or Compare Float) **

    Comment


      #3
      If i understad it correctly. You can use a variable to store your value. Then compare it with the new value, and then store the new value as the old. The you should have a branch for > and <, and it will ignore it if the value is the same.

      Comment


        #4
        I, too, have thought about this numerous times and was always using the "workaround" that ziarra proposed.
        So, there is no more elegant way to fire code whenever a particular variable was changed? I mean, the workaround is not too complicated, but it requires adding new variables and continuously setting them, which makes larger blueprints slightly more complicated and less clearly to grasp...
        Check out my GTA2 remake in UE4

        Comment


          #5
          If code/script needs fire every time a variable gets a new value that variable should be private, and you should write functions in the blueprint to "get" and "set" the value of the variable.
          In the "set" function, you write the logic to compare the new value with the old value and determine if the variable increased or decreased (<, >, etc.).
          If you need multiple different blueprints to run code when the variable is changed you can use an event dispatcher.

          Comment

          Working...
          X