Godot Version
4.3
Question
Hello, so I’m struggling to understand why I can’t seem to get “_focus_entered()” to work on my script. Basically, when I enter a button’s focus, I want my script to activate a line of code, however attempting to write any code under the signal function “_focus_entered()” will result in nothing occurring.
A strange oddity I also noticed is that if I were to type “_pres”, the editor would give an auto-complete suggestion of the “_pressed()” signal function, meanwhile doing any variation of “_focus_entered()” or “_focus_exited()” will give no results as if the function doesn’t exist.
Am I doing something wrong here / missing something important? I’ve tried variations of the name as well, like “focus_entered()”, “_on_focus_entered()”, etc. but none have seemingly worked. Any help would greatly be appreciated!
For reference, the script shown below is meant to be attached to each individual button. These buttons are then placed 4 in a row in an HBoxContainer.
My expected outcome is for “b” to be printed to the console every time I move the focus between the buttons, but nothing is ever actually being printed. (The “_pressed()” signal function however does correctly print “a” when the button is pressed)
extends Button
func _pressed():
print("a")
func _focus_entered():
print("b")