Item unfocusing when clicked

Godot Version

v4.2.2.stable.official [15073afe3]

Question

I’m working on a crafting menu and I’m trying to add controller support but the item (now using the focus system) unfocuses when clicked. Nothing in the code runs on click

(Here’s the code for the item)

And a quick screen recording to show what I mean

I think you will not be able to click a button if the parent control node is stealing focus. Can you make the button or which ever node handles clicked events grab_focus instead?

Oh, I guess i forgot to share the screenshot of the card. Its not a button but a custom control node, the control node has the script and handles in focus (you can see in the screenshot)

Nothing else in the scene to my knowledge should take focus

I see the Control node also has gui_input connected, does that function ever fire? test with a print?

No, The code thats connected to that node is the one in the pastebin, forgot to disconnect that i guess

The higher up crafting menu takes care of the click, shouldn’t affect anything

Edit: It doesn’t, Just removed any input handling from the menu and it didnt fix anything

The invisible button of which I forgot about was causing all of my issues.
The lesson? Don’t forget to delete temp work

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.