godot-extended-libraries / godot-debug-menu

Display in-game FPS/performance/hardware metrics in a Godot 4.x project
https://github.com/godot-extended-libraries/godot-debug-menu-demo
MIT License
454 stars 18 forks source link

Calling "DebugMenu.style" returns "Invalid get index 'style' (on base: 'CanvasLayer')" #20

Closed Arnklit closed 11 months ago

Arnklit commented 1 year ago

The addon is working well with the F3 shortcut, but I tried to make an on screen button to toggle it but calling the DebugMenu.style is for some reason causing the "Invalid get index 'style' (on base: 'CanvasLayer')" error.

The singleton is loaded and everything seems to be working, so why it's retuning a CanvasLayer instead of a script instance is beyond me.

Using Godot 4.1.2.stable. I'll update if I figure out what causes it.

image

Havasi-Scarlet-5 commented 11 months ago

try like this: DebugMenu.get_node("DebugMenu").style = DebugMenu.get_node("DebugMenu").Style.VISIBLE_COMPACT

Calinou commented 11 months ago

Thanks for the report! Consolidating in https://github.com/godot-extended-libraries/godot-debug-menu/issues/15, which was fixed by https://github.com/godot-extended-libraries/godot-debug-menu/pull/16 but isn't present in a tagged release yet.