Godot Version
4.2
Question
Just like the title says, I have a timer that is suppose to trigger the “_on_button_pressed()” function of a button, after a certain time occurs.
Both the timer and button are in the same tree/scene.
^If the above photo doesnt load , here is the code:
@onready var autoTime = 0
func _on_auto_play_timer_timeout():
autoTime += 1
print("autoTime: ", autoTime)
if autoTime % 2 == 0:
texture_button.connect("pressed",_on_button_pressed)
I have done multiple google searches, but no result has actually worked. The godot docs aren’t helpful either.
At one point, I gave up entirely on using code and tried forcing “auto play” with an animation player. That didn’t work, so now I’m back to square 1.
This is not my first time working with signals/connect so IDK why it’s not working now? It has been awhile so maybe I’m just missing something here . . .
I could have sworn the connecting nodes used to be $Node.connect(self,“----”,“—”), but maybe it was changed?