I'm having some problems with script inheritance.
I have one base script
Object.gd (only the relevant part) :
#Signal when click on the Area2D
func _on_Area_input_event(viewport, event, shape_idx):
print("click") #I get this printed so the signal is received normally
if GLOBAL.game_mode == 1: #Easy mode
else: #Normal mode
pass #Not implemented yet
if choice_id == 0: #Look
#Connect this to the Part's root
func _choice_logic(choice_id): #Abstract, should be implemented in the instance's script
So now I create an instance of
Object.tscn (which contains nodes with connected signals), attach a new empty script inherited from
But it does something weird at runtime:
When I trigger the "Area2Dinputevent" signal in the instanced object, the function
_on_Area_input_event() actually triggers too, but it doesn't call
_choice_click() when it should, it just run past them when I debug, which I can't understand.
Is this a bug or is it intentional? In both cases, how can I make the script call the functions I need without rewriting them in each instance's script?
PS: I'm on Godot 3.1 stable.