Help Using Signals with the goal of Getting Results in the Editor before Runtime

Godot Version



I am new to Godot and am just now starting to get the hang of the syntax. I have made some lovely classes that do exactly what I want, but I want to see the results before I actually run the playbacks (example: i click a button, and it changes the Sprite of the related object, or i adjust an int and it changes the rotation or size, all while inside the scene editor).

I have no idea if that is even possible, but given the examples I’ve seen in the documentation (which have similar results?) I theorize that I could use Signals to trigger when a variable changes in the editor and have it throw a function to do what I want.

Assuming Signals are in fact the answer (which I cannot say for sure is true – there might be another solution I’m not aware of?):

The problem is I am still not sure how to script signals. I don’t have a mind for them yet and my research is not getting me anywhere.

I have read the documentation regarding Signals several times, but I’m afraid I still can’t quite grasp how to script them, even if I understand the basics of how to use the preset ones in the editor.

I’m aware that the “Node” tab has a “signals” sub-tab, and if I doubleclick the desired ‘signal,’ it will give me a function in the desired script that will execute if the ‘signal’ is ‘emitted’. I’ve had success with this already using Area2D collision detection.

But I have reached a point where I need to start making my own signals, and the documentation just isn’t clicking for me in my head. I don’t know if I’m just inefficient at reading the documentation or if my learning style isn’t compatible with it, but I am hoping that someone here will be kind enough to help me out (or at least point me in the right direction).


I have a custom Resource:


extends Resource

## The [Resource] parent class

class_name ParentResourceObject

signal a_change

func something_changing () :

…and I have several extension of this Resource that look like this:


extends ParentResourceObject

## A [Resource] child class

class_name ChildResourceObject

## An enumerated choice in the editor
@export_enum("A", "B", "C") var choice : String  = "A"

I then also have various Scripts which attach directly to a Node like so:


extends Node2D

## A Node2D with a script
class_name CustomNodeObject

@export var resource1 : ChildResourceObjectType1
@export var resource2 : ChildResourceObjectType2

signal node_event

# Called when the node enters the scene tree for the first time.
func _ready():
	do_resource_stuff ()

func do_resource_stuff () :
	match resource1.choice
		"A": #do something
		"B": #do something
		"C": #do something
	else: #do something  -- this is probably an error though

	match resource2.choice
		"A": #do something
		"B": #do something
		"C": #do something
		#do something -- this is probably an error though

When I “run the project” or “run current scene”, this does exactly as I intend it to! However, changing the values of the ChildResourceObjects’ “choice” variables only affects the results at Runtime. My next step is to make them work before runtime, in the editor.

The issue lies in that I can’t quite grasp how to go about it: adding a Signal to the Resource classes doesn’t give me any result in the editor, so I can’t just add a get/set. But I also cannot figure out if it’s possible to connect a signal I make in the Node2D class (which DOES appear in the editor) to the change of a value in the resource-type variables.

I’m certain there is some fundamental, obvious fact that I’m just not getting. It’s probably in documentation and I just haven’t found it or haven’t understood it. But regardless, I’d appreciate it if someone could point it out to me.

Thank you in advance (and I hope I provided enough context).