Check if Variable is changed

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bot7

How can I check if a variable was changed ?

:bust_in_silhouette: Reply From: deaton64

HI,

That’s quite an open question.

Depends what you’re doing and when you want to know when the variable was changed.

Maybe something like…

Before a function:
Save the variable into a temp variable.
Do the function
Then check if the variable is different to the temp variable.

In a scene:
Save the variable to a temp variable in the ready function.
In the process function or a timer function check if the variable matches the temp variable, if they are different, call a signal or other function.

ok thanks I think that should work but I thought there is a function or something else that gives a signal when the variable is changed.

Bot7 | 2021-01-17 16:54

yeah, there might be. Not sure… :slight_smile:

deaton64 | 2021-01-17 17:25

:bust_in_silhouette: Reply From: aipie

Perhaps “setget” could help here