Please tell me how to use Signal.

I’ve read the manual, but I don’t understand how to use signals…:sob: I would appreciate your guidance.

As a practice, I’m trying a simple process where I place a button on the UI layer of Scene 1, and when the button is pressed, a signal is sent to a game object. A visual script attached to that game object then ends the scene, and a scene transition moves to Scene 2. However, I’m not succeeding.

I probably haven’t detected the signal correctly, but I don’t quite understand how to set up the condition below.

Could it be that signals from components like button or area2d cannot be used in visual scripts at all?

2 Likes

In this case, to receive it via Visual Scripting, the function must have two arguments.

Since elements like buttons only have one argument, they cannot be properly received in Visual Scripting… Therefore, the solution is to have two arguments. The following methods are available:

  1. Receive the Button signal in a separate GDScript attached to another node.
  2. Connect that node and GameObject manually as described in the documentation, and send the signal in the format signal(signal_name, value).

Additionally, Baz has created a plugin related to this, so it might be beneficial to install the following plugin:

I was able to implement the desired behavior using Baz’s plugin!

Thank you very much.

2 Likes