How to detect when Integer changes?

I have an integer, used as the current day in the game. When it is a new day, I want to be able to call a custom event. The problem is that I cannot figure out how to call that event when the integer changes. How would I do this?

If it’s a single player game your best bet is to change from setting the variable directly and instead creating a function that sets it.

Alternatively you could have a check on tick or timer for checking if it changed but that is much more expensive and requires duplicate variables.

If a always-multiplayer game you could use a Rep_Notify variable to do as you want but this won’t work in standalone.

In the same event that updates the integer you would call the custom event.

If you need to detect a change as such that would be something that constantly checks if the value is the same, like event tick. I’d steer away from that.

Perfect, thanks!

Perfect, thanks!