Godot4

signals

Valentyne 2023. 11. 22. 17:32

https://docs.godotengine.org/en/stable/getting_started/step_by_step/signals.html

 

Signals are a delegation mechanism built into Godot that allows one game object to react to a change in another without them referencing one another. Using signals limits coupling and keeps your code flexible.

 

에디터를 이용하는 방법과 signal의 .connect를 이용하는 두가지 방법이 있다.

또 직접 signal을 만들어 .emit으로 시그널을 보낼수 있다.

 

Any node in Godot emits signals when something specific happens to them, like a button being pressed. Other nodes can connect to individual signals and react to selected events.