Hi,
I am very new to Defold and am learning lua as I go. I have created a node named ‘Button’ and I want the user to click the button to display text. Eventually, this will become a button that, when pressed, displays an image.
It is detecting the user’s input but spits out the below error:
function init(self)
msg.post(".", "acquire_input_focus")
end
function on_input(self, action_id, action)
if action_id == hash("Mouse") and action.pressed then
local button = gui.get_node("Button")
if gui.pick_node(Button, action.x, action.y) then
--ERROR:SCRIPT: /main/Scripts/Button.gui_script:8: bad argument #1 to 'pick_node' (userdata expected, got nil)
print("Congrats you clicked it")
end
end
end
What am I doing wrong?
Thanks!!
Badgerous