Spamming error msg "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal." when displaying more than 1 instances of a same CharacterBody2D.

This error kept spamming in console (hundreds per second).
Only having 1 visible in the editor doesn't cause this error.
Adding 2 different CharacterBody2D doesn't cause this error.
Turn off the visibility can stop the spamming.

Everything worked well including the exported game.

Anyone has a clue?

  • Toxe replied to this.

    SL00 Are you using custom draw functions and are you doing so outside of _draw()?

    • SL00 replied to this.

      Toxe No. It's a set of polygons animated with skeleton2d.

      And the error happened in editor, when the scene's not runned.

      Sounds like you might be running into some edge case bug with the editor. Perhaps you should report it to the tracker. Make sure to try and search tracker to see if an issue for this already exists, but don't sweat over it too much.

      If a duplicate exists and you just missed it then the developers will leave a message stating that it's a duplicate of #[issue ID] and close your duplicate, and you'll know to follow the correct issue.

      21 days later

      Had same issue, no draw function anywhere, and the same message was spammed in the console when having 2 instance of the same scene which contained a SkeletonBody2d

      2 months later

      Same here Godot v 4.2.1 uppon adding Skeleton2D and enabling it getting same message spam.

      • Toxe replied to this.

        P0RANT That might be a bug. You should report it on GitHub.

        7 months later

        Hey, I was running into the exact same issue. Turns out the issue was somehow caused by a broken Modification Stack on the Skeleton2D node. I removed the two disabled modification stack features and now I get no issues.
        Edit: no that wasn't it, it's still broken.
        Edit 2: updated to the newest beta version of Godot 4.3, works well now. No errors.
        Edit 3: It came back lol.

        2 months later