This time I'm attempting to access the Mouse object's X & Y expressions from a custom plugin.
In my project, I have the Mouse plugin and my custom plugin loaded. From the custom plugin, I am attempting to access the expressions from a condition. I am using the following lines:
I receive the following error when the condition is executed:
TypeError: this.runtime is undefined
http://localhost:50000/Mouse_plugin.js, line 339
This is either a bug in Construct 2 or a problem in a third party
plugin or behavior - please report it to the developer!
Line 339 of the Mouse plugin is:
layer = this.runtime.getLayerByNumber(layerparam);
I only have 1 layer in the project (layer 0).
Any assistance would be appreciated.
So it became obvious that I am not working with an instance of the Mouse object, thus the errors. But I can't seem to figure out how to obtain a reference to the instance. I've followed @rexrainbow's logic in this post: http://www.scirra.com/forum/behavior-accessing-a-plugin_topic50811.html, but it isn't working for me.
Again, any assistance would be appreciated.