Why is button_up not working

Godot Version

4

Question

I was following this tutorial and some thing went wrong please help me

According to the error message in red below, the node you are grabbing with $CanvasLayer/Deathscreen/Panel/Button is not a Button but instead a Label. And labels do not have a button_up signal.
Maybe you accidentally created a Label when you meant to create a Button? Or perhaps your nodes aren’t named correctly?

Also, I am not sure what button_up.restart() is supposed to do. :thinking: Do you mind linking the tutorial here so we could take a look into it? Some tutorials back from the Godot 3 era might not work anymore because of syntax changes.

I guess he wants to restart game after button press.

.../Button.button_up.connect(restart)

https://www.youtube.com/watch?v=jzbgH4AMtI8&t=1016s I used this tutorial

Yup, looks like your line needs to be
$CanvasLayer/Deathscreen/Panel/Button.button_up.connect(restart)
just like @trizZzle said. I didn’t notice the restart function in the screenshot so thx for pointing it out. ^^

Also check whether your death screen is called Deathscreen or DeathScreen because the tutorial capitalizes while you didn’t. Not that you have to but you have to stick to one way of writing it.

As for the error message, check your scene tree at the top right of Godot and make sure that your button is indeed called Button; because whatever is called Button right now is a label. You can rename a node by either double clicking it or rightclicking and then “Rename”.

Hope this helped. :>