Elektrine lite

← Feed

@godot_dater@mastodon.world

2026-09-20 15:00 UTC

I had some very weird experience with the Godot engine today. I made a new scene that inherits from Button, and gave it a `class_name` so I can instantiate it easily from code. And when I do this, connecting the Button's signals to the function inside the code of the extended button scene, the signals don't work. But if I connect it from code from the scene's `_ready` function, then everything is a-OK. Is this a #bug or did I miss something in the manual? #godotEngine #bugReport #gamedev

Replies (2)

  • @godot_dater@mastodon.world Doesn't sound like a bug to me, when extending control classes it's best to assign their signals manually in code unless you're instantiating the scene manually for each one in my experience. Or have one UI Manager global script that goes through the tree on _ready, looks for any buttons and does all the signal connecting for you. That's what I did for my game. I control all my UI juice, sounds, tweens, etc from a single script and it works wonders!

    Open ##5254784

  • @godot_dater@mastodon.world it sounds like maybe some confusion around instantiating a class vs instantiating a scene? The signals you've defined all live in the. tscn file, so you only get them if you create an instance of the tscn file, not using the class via code or "attach script".

    Open ##5254786