How to make a blinking button (also may have found a possible bug)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By shuyin

Hi guys,

So I wanted to make a blinking button. I used a TexturedButton node and added a child Tween node.

Then from my script, I wrote a function that I call whenever the condition for the blinking button is fulfilled.

The code is similar to this:

func blink:

$tween.interpolate_property(button, “modulate:a”, 1, 0, 0.3)

$tween.start()

yield($tween, “tween_completed”)

$tween.interpolate_property(button, “modulate:a”, 0, 1, 0.1)

$tween.start()

My problem is that whenever I call the function my button becomes transparent and remains that way.

I’ve even tried running just the last tween (modulate:a, 0, 1, 0.1) so that it ends up at full opacity (1) but the button still ends up being transparent.

so, I’m assuming it’s a bug with the buttons?

Also, is there any way of making a blinking button in Godot, using the Button or TexturedButton nodes?