Getting node id to update Gooey

Is there a way to get a dynamically created node’s id? This is the code I’m using, but gui.get_id() always returns an empty hash:

local nodes = gui.clone_tree( node )
local node = nodes["character/character"]
print( node ) -- DEBUG:SCRIPT: box@(0, 53, 0)
local node_id = gui.get_id(node)
print( node_id ) -- DEBUG:SCRIPT: hash: []

I need the id to update gooey:

gooey.button(node_id, action_id, action, on_character_pressed, ui.update_static_button)

Edit: Found this is a known issue and also found the gui.set_id() workaround: https://github.com/britzl/defold-input/issues/5

1 Like

I’m actually not entirely sure why we don’t assign a node id to cloned nodes. It feels a bit weird that the id is an empty hash.

2 Likes

Bumped into this again, so opened an issue for it: https://github.com/defold/defold/issues/7209