Material Box

Material Box

WEB Design & Material Images

Godot - Disabling a Button

Godot

This code example shows how to disable a Button node using GDScript.


To temporarily disable the functionality of a Button, set the `disabled` property to `true`.
The style of a disabled Button node can be changed using the `disabled` section of the stylebox.

# Create a Button node
var button = Button.new()
add_child(button)
button.text = "Button"

# Disable the button
button.disabled = true

To enable the button again, set the `disabled` property to `false`.


# Enable the button
button.disabled = false

Godot

TitleGodot - Disabling a Button

CategoryGodot

Created

Update

AuthorYousuke.U