• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Nesting functions

Status
Not open for further replies.

Dev_M

Member
Hello,

I wonder if this is a bug or not...

func_1 = function(){
code
}

func_2 = function(){

func_1();
code
}


When I place this in a create event, it calls the func_1 code without me executing func_2....
Is this a bug or is it not allowed to nest functions like this?

Im on latest version.


Thanks in advance
 

rytan451

Member
If your code looks like this:

GML:
/// @desc Create event

a = function() {
    show_debug_message("first function called");
}

b = function() {
    a();
    show_debug_message("second function called");
}
If your debug log shows first function called, then there is probably a bug. I'll see if I can reproduce this bug on my end. Cannot reproduce. Are you sure you aren't calling either of these functions?
 

TsukaYuriko

☄️
Forum Staff
Moderator
I'll be closing this topic because, as of writing, 2.3 questions should not be posted on here, but in the beta forum. The GMC will be open for 2.3-related questions once a stable build is released. Until then, please use the beta forum.
 
Status
Not open for further replies.
Top