B
bigtunacan
Guest
I was trying to retrieve an instance of an object from another object's event code, but just kept getting an error message.
This would continue to error out that pause_id is undefined.
I ended up working around the issue because this is a single static menu object that I pre-place in the room so I used the instance ID that is shown in the room editor. "inst_5AD07BFE"
I am still wondering though, what is the proper way to do this dynamically in code as it will probably come up again, but also is it safe/good practice to just use the instance ID shown in the instance layer properties like I have done?
Code:
pause_id = instance_find(obj_pause_button, noone);
show_debug_message("Pause ID :: " + pause_id);
I ended up working around the issue because this is a single static menu object that I pre-place in the room so I used the instance ID that is shown in the room editor. "inst_5AD07BFE"
I am still wondering though, what is the proper way to do this dynamically in code as it will probably come up again, but also is it safe/good practice to just use the instance ID shown in the instance layer properties like I have done?