[SOLVED] Uncaught RangeError: Maximum call stack size exceeded

Have a new error when launching my game Herbivore: (testplayer mode)
I’m working now in scenes that haven’t even been loaded, the time the error occurs. At that moment nothing in my code should have been changend. So I’ve simply no idea where to look, to get this solved. I’m verry grateful for any hint :heart_eyes:

best regards
:cucumber:

Can you screenshot or copy the error here please?

If it’s related to physics, chances are that you have a highly detailed model that’s being used for collision. It’s recommended to use as low poly as possible for collision meshes.

image
image
I have only one mesh collison, the terrain wit about 400 triangle polygones. But I haven’t change this in more than a half year. Every other collison is of type cylinder or box.

Hi, I have an occasional error due that is probably due to a recursive function. I thought I mention it just in case you have something similar.

2 Likes

That looks like an infinite loop at a glance

Maybe a loop, but most likely not an infinite.
Code executes after this, it’s just very slow while trying…
If I just knew, whats been tryed here, I thinck I can solve.
I just don’t know where to start. When it’s quite clear thats
about collision, I’m already been helped…

I agree with Kulodo133, looks like a recursive function call.

Edit: It’s very possible that you have a very deep hierarchy that may cause a similar issue.

Looks like calling:

SetUpactionMenue.prototype.initialize = function() {
    
    this.entity.findByName('ActionMenueOpen').enabled = true;
    this.app.fire('action:load', true);
    
    this.app.root.findByName('Globals').script.globals.loadControllerRowA();
    this.app.root.findByName('Globals').script.globals.loadControllerRowB();
};

Is calling this recursive function:

Globals.prototype.loadControllerRowA= function () {
    if(this.app.root.findByName('rootAction')){
        this.app.root.findByName('rootAction').findByName('MenueKeyboard').script.menueKeyboardSetup.loadRowA(ControllerRowA);
    }
};

Which is calling

MenueKeyboardSetup.prototype.loadRowA = function (){
    KeyboardRowA = this.app.root.findByName('Globals').script.globals.loadControllerRowA();
    console.log(KeyboardRowA);
    this.setRowA();
};

Which is calling Globals.prototype.loadControllerRowA again. This is causing an infinite loop and your error message

2 Likes

Wow… I’ve great trouble to understand my own code, and you navigate through it like nothing… I’m deep impressed :open_mouth: I’ve worked recently on customize keyboard input. This makes perfect sence … Thanx so much :kissing_heart:

solved :smiley:
it had to be globals.getControllerA instead of globals.loadControllerA … stupid me :flushed: Would have spend days to solve this without your help… sorry for asking at a weekend. It’s always me and not the engine… hopefully next time I remember :crazy_face:

1 Like