Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

You’d want to not pass the argument to built-in function if it’s undefined (since it checks argument count, not if it’s undefined), though in this case you can also do just

live_function_add("instance_create_layer(x, y, layer, obj, ?var_struct)", instance_create_layer)

or, if that will not work,

live_function_add("instance_create_layer(x, y, layer, obj, ?var_struct)", method(undefined, instance_create_layer))

This one works great:

live_function_add("instance_create_layer(x, y, layer, obj, ?var_struct)", instance_create_layer)

 Thanks!