Godot 3.1 beta + visual script: what I'm doing wrong?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Albert

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?

can you send video or screenshot?

bdashraful | 2019-01-24 20:13

:bust_in_silhouette: Reply From: fpicoral

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.

:bust_in_silhouette: Reply From: vic.the.developer

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.