This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

On 3.1 beta I can't reproduce this https://youtu.be/m2j-JNLCoG8

That is when I drag-n-drop label text on visual script window, then it added as "set text.. on scene node", not as "node set.. label text", and as a result when I run it and press the button, I don't see label text at all, although I expect to see new text

What is I just want to set new label text when I press a button, using visual script.
What I do wrong?

in Engine by (12 points)
edited by

can you send video or screenshot?

2 Answers

0 votes

You need to provide a screenshot or your project so we can try to help you.

I strongly suggest that you try GDScript, it's sooo easy and I (for real) think that it's easier to make scripts using GDScript than in VisualScript, beside that in GD you can keep things more organizated and you can do more in less time since you don't have to connect lines and etc.

For exemple, what you want to do you could do in GDScript just by typing $YourLabelName.text = "the new text".

I really recommend this course on Udemy, I saw it myself and I can say that its really great; it goes from the very very basics to more advanced stuff, it's totally worth the $20.

by (519 points)
0 votes

Here's a screenshot as simple as I can get it in Visual Script:

Connect signal pressed() from Button in the Node panel (beside Inspector) to your visual script. With that Visual Script open, drag Text in from the right Inspector panel ( need to have label selected on the right side in the Scene Panel)

Connect the two with the white line, type in your text, hit enter so you see it in the box like in the screenshot and run it.

enter image description here

by (115 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.