My signal will not link with other scenes

Godot Version

Question

I want to emit a signal called speed_up from game manager, and for it to be received in every instance of pipe. The problem is, is that the signal speed_up is not present as an option to link in the pipe scene, but it is for the game manager scene. Do you know why?

this is very simple and obvious ; its not in other scenes . it does not work like this .

for solving your problem ; we can connect it eazy by a connect method in ready function .

like this :

func _ready ()-> void :
    yoursignal.connect(your_method)

func your_method () :
   #code to execute
1 Like

%“game manger”.speed_up.connect(on_speed_up)

what have i done wrong here, its returning a few errors

I wouldn’t use spaces in my node / class names.
When you want to use unique names (with the %) you have to set the node to “unique name” first. Right click on the node and select “Access as unique name”.

it already is selected as unique, i really cant tell what ive done wrong

You have declared the signal speed up in the global manager node (script). This means that game manager is the “owner” of the signal and as such it will only appear in the inspector when you select the game manager node. To sum up signals appear in the node where they are declared.

If you want to connect the signal graphically you have to go to the game manager node, click the speed up signal and then a dialog will appear to select the node you want to connect the signal to (the pipe).

However, I think what you want might be a different thing, correct me if I’m wrong. You want a single game manager node that fires up the speed_up signal and then every pipe receives that signal.

With the setup that you have right now, you are creating 1 game manager for each pipe, so the first thing you need is to create a GLOBAL game manager scene. You can check how to do it here.

Once you have created the global scene and given it a name you can reference that name in your script and connect it as others have suggested. Imagine I used the name GlobalGameManager

func _ready():
	GlobalGameManager.speed_up.connect(method)
	

func method():
	# your code here
	pass

2 Likes

Your pipe scene does not have a game manager (you wrote game manger) as its child. When you use $ and % you are trying to access a CHILD node. This means that pipe only has access to Sprite2D Timer and CollisionShape2D.

If you want to access game manager from pipe without game manager being a child of pipe you need to make it global. You can check out how to do it here.

I provided a better explanation in this reply.

I don’t mean to be rude; I know these things can be confusing, but foundations are important, and it is really vital to know the basics. I would advise to learn the basics really well and understand the node system. It might be boring at the beginning, but you’ll have less headaches in the long run