InstallEventHandler question regarding the function
Posted: Thu Feb 25, 2021 10:28 am
I have this:
This works fine in sense that the right function gets executed.
However, I am having one problem with the function that I am not sure what is the root reason or how to fix it.
Thing is, I have something like:
And problem is that it seems I don't seem to able to update this variable.
For at start I set this myvariable to "none" and then elsewhere in code I do:
and it seems to have that "something" where ever else in that OOP I try it, but when I i push a key down, it keeps debugprinting "none".
As far as I have understood, this system I am using on InstallEventHandler should make it to call the function dynamically, but based upon it not working as expected, is it then saving it somehow into its current state and hence it keeps thinking that myvariable is "none" instead of "something"?
Code: Select all
InstallEventHandler({OnKeyDown = Function(msg) Self:HandleOnKeyDown(msg) EndFunction})However, I am having one problem with the function that I am not sure what is the root reason or how to fix it.
Thing is, I have something like:
Code: Select all
function OOP:HandleOnKeyDown(msg)
debugprint(self.myvariable)
endfunctionFor at start I set this myvariable to "none" and then elsewhere in code I do:
Code: Select all
self.myvariable = "something"As far as I have understood, this system I am using on InstallEventHandler should make it to call the function dynamically, but based upon it not working as expected, is it then saving it somehow into its current state and hence it keeps thinking that myvariable is "none" instead of "something"?