Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | tautologias345 |
When the user clicks on a button, I want to write a script on C#. How can I write?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | tautologias345 |
When the user clicks on a button, I want to write a script on C#. How can I write?
Reply From: | Help me please |
For this you need to use its pressed
signal. Click on the button node in the scene dock panel… In the inspector select node. By default signals would be selected. Then there double click on the pressed
signal. if you want then change recievers method and finally click connect. But remember the node to which you are connecting signals must have a script.
This works in both c# and gdscript.
Docs: Using signals — Godot Engine (stable) documentation in English