Hi community,

Is there a way to achieve something like OnVariableChange event in ORK or Makinom?

Any thought?
  • Yes, but only through scripting. Variables are handled by the VariableHandler class, which has an event listener you can register to. The function you register there will be called when a variable of that handler changes.

    E.g. to register to global variable changes:
    ORK.Game.Variables.Changed += YourFunction;
    The function would look like this:
    public void YourFunction() {
    // your code
    }
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks GIL. That's good enough for me to start.

    I just checked the tutorial, and found:
    '''
    Variable Handler: ORK.Game.Variables
    The Variable Handler manages all global game variables.
    '''

    Just want to quickly confirm: is this only applicable to global game variables? How about object variables component?

    Thanks again!

  • edited February 2018
    It's the same for all variables origins, as they all use the VariableHandler class. Naturally, you'll need to change that line of code to register to the variable handler you want.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.