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
Announcement
Collapse
No announcement yet.
Detct Increases decreases value
Collapse
X
-
[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) **
-
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
-
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
Comment