Inheritance of scripts bugging when trying to add multiple buttons

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By l3th0n

Hello :slight_smile:

I am trying to create different buttons with different functionality, which should be easy except the inheritance thing makes one global script for the Button node.
Why can’t I say, that this node’s script is specific to this node? Otherwise I will have to, as I see it, create a lot of IF statement in _on_button_pressed().
I realize I probably missed something important about the inheritance structure and how to navigate it, but from what I’ve read so far it doesn’t make sense.
Any documentation or some kind of insight would be nice.

:bust_in_silhouette: Reply From: l3th0n

I found out that I could make the script unique under the script option on the node. This solves what I was describing. But I kinda see the point of it all being in one script when you name a new function something like “_on_Button2_pressed()” then there should be no conflict.

:bust_in_silhouette: Reply From: BraindeadBZH

Yes you missed something. When you inherit from a scene to create an inherited script you have right-click the root node of the inherited scene and click “Extend Script”.