SignalBus is a Godot editor plugin that enables the creation of global signals! Global signals may be emitted from and/or connected to any script in your project.
A core singleton script that manages the addition, modification, removal, and emitting of global signals. Global signals are saved directly in your project settings, allowing for complete portability across devices.
A node that allows a global signal to connect directly to a chosen callable (method) in the parent node, with no scripting required.
- Several unrelated classes must define and emit the same signal.
- You are dealing with complex Node or SceneTree hierarchies.
- You need global events that can be accessed by any object.
1️⃣ Open the Godot Asset Library from the Godot Editor.
2️⃣ Search for SignalBus and click Download.
3️⃣ Enable the plugin via Project Settings > Plugins.
1️⃣ Download or Clone the repository.
2️⃣ Copy the addons/signal_bus/ folder into your Godot project's addons/ directory.
3️⃣ Enable the plugin via Project Settings > Plugins.
The following example assumes that you have defined a global signal game_over. If you have not done so you can define a global signal by...
1️⃣ After enabling the plugin, select the SignalBus tab in Project Settings.
2️⃣ Input the name game_over in the Add New Global Signal field.
3️⃣ Press Enter or select the + Add button.
Add the following line to a script to add the global signal
SignalBus.add_global_signal("game_over")
After making sure that the game_over global signal is registered in SignalBus...
# Emitting a signal
SignalBus.emit_signal("game_over")
# Listening to a signal
SignalBus.connect("game_over", Callable(self, "_on_game_over"))
func _on_game_over():
print("Game over!")
SignalBus does not replace Godot’s built-in signal system. Most implementations do not require global signals.
Although the plugin make's use of Gut for testing purposes, it is not a mandatory dependency and will not impact SignalBus' functionatliy if it is not included.
This plugin is open-source and licensed under MIT License. Feel free to use, modify, and distribute it as needed.
📢 Feedback is welcome! 🚀