How do i make buttons work properly?

Godot Version

4.2.1

Question

So i made a button and all i want from that button is for when its clicked that it makes a part invisible so i made this script:

@onready var button = $Button as Button

func _on_button_pressed():
global.mouse_click = true

and in the other script i said that when global,mouse_click is true than that part gets invisible.But it wont do it.Can anyone tell me what did i do wrong?

It would be very useful to have more information to help you. Could you share your project so we can take a deeper look?

change alpha to 0?

1 Like

Sure ill send it in 10 hours or so

Coupd you send it now?