Imperial
Member
Hello
let's suppose we have a player object with 2 events
Create Event
Step Event
and then you try to create a player instance and give it a method
so the problem is I don't know how to assign undefined again to the update variable to make it stop checking once the condition is true
I appreciate it if you enlighten me
let's suppose we have a player object with 2 events
Create Event
GML:
update = undefined;
GML:
if(is_method(update))
{
update();
}
GML:
var inst = instance_create_layer(0,0,"Layer 1",obj_player);
inst.update = function()
{
if(x >= room_width/2)
{
show_debug_message("Level Completed");
//What to do to make this method equals to undefined again ???
}
}
I appreciate it if you enlighten me
Last edited: