0 votes

Hey everyone I am trying to make it so that a toggle button will turn on and off the wings but it seems like the toggle button doesn't update for some odd reason. Look at my script and my debug log. Can anyone tell me why?

SCRIPT:

func ready():
    set_fixed_process(true)
    hide()

func _on_Wings_pressed():
    show()
    update()
    print("is on")
    update()

func _on_Wings_released():
    hide()
    update()
    print("is off")
    update()

Debug Log after toggling the switch on and off a few times:

is on
is on
is on
is on
is on
is on
is on

Here's a picture of the game and engine so you have a better idea of what I mean:
enter image description here

in Engine by (21 points)

can't tell much with given information.
need more script or connection info.

1 Answer

0 votes

I think you need to connect to the toggled signal of the control instead.

by (182 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.