0 votes

I want to be able to click a button and toggle it on and then click another button to toggle it off. But how do i set a button thats set to toggle mode back to neutral using script

asked Jun 4 in Engine by Superkrypet (29 points)

_button.pressed = not _button.pressed

1 Answer

0 votes

If your scene tree looks like this:
Any node with script attached

Button1 (Toggle mode active)
Button2 (signal onButton2_pressed connected to the root node's script)

In the script:
extends Node (or whatever node your root node is/the node this script is attached to)

_on_Button2_pressed():
    $Button1.button_pressed = false
answered Jun 4 by MaaaxiKing (291 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 How to use this Q&A? before posting your first questions.