With this function you can retrieve the instance ID or struct reference which is the self context used when the method is called. If the variable is not a method then the function will return undefined. Please note that the function may also return the constant pointer_null, in which case the current self is being used at the time of the call.
method_get_self(method);
Argument | Type | Description |
---|---|---|
method | Method | The method variable to check. |
Object Instance, Struct, undefined, or pointer_null
var _self = method_get_self(light_properties);
show_debug_message(string(_self));
The above code gets the self context for the given method variable and outputs it to the console.