Announcement

Collapse
No announcement yet.

Exececute on variable change.

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

    Exececute on variable change.

    I have a Boolean which is set every frame based on whether my player is under a roof. Then I push or pop a sound mix based on the result, but this is not only inefficient, for some reason it's causing the soundmix to not transition properly. I'm wondering what's the easiest/best way to only execute the sound mix change when the variable has changed. More (I'm guessing) like how the on overlap & end overlap feature works. I'll upload a picture of my nodes later. Thanks!

    #2
    That's simple, just make a 2nd Boolean called 'oldVARNAMEHERE' and set it to the 1st Boolean right after setting the 1st one. And then in-between the two 'set variable' nodes, have a branch that checks whether or not the 1st and 2nd Booleans are the same, if they are not, then it has changed that frame.
    Marketplace Assets

    Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
    Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
    Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

    Comment

    Working...
    X