I cannot switch from my Gui to my level. I am using collection proxies and I can’t tell the issue.
Error: Could not send message ‘start_game’ from ‘mainmenu:/go#mainmenu’ to ‘main:/go#loader’
My main menu script:
function init(self)
msg.post(".", "acquire_input_focus")
end
function on_input(self, action_id, action)
if(action_id == hash("touch") and action.released == true) then
local textBegin = gui.get_node("startGame")
if(gui.pick_node(textBegin,action.x,action.y)) then
msg.post("main:/go#loader", "start_game")
end
end
if(action_id == hash("touch") and action.released == true) then
local textExit = gui.get_node("exitGame")
if(gui.pick_node(textExit,action.x,action.y)) then
msg.post("@system:", "exit", {code = 0})
end
end
end
It is almost impossible for us to understand what you mean. Please provide more info.
You are trying to send message from “mainmenu” collection to “main” collection. Is “main” collection even exist? Seems like it doesn’t.
You can share your proxy loading( main:/go#loader) code for example… Or a small repo case.
And please use “code fences” for your codes, it is so hard to read this way:
function init(self)
msg.post(".", “acquire_input_focus”)
end
function on_input(self, action_id, action)
if(action_id == hash(“touch”) and action.released == true) then
local textBegin = gui.get_node(“startGame”)
if(gui.pick_node(textBegin,action.x,action.y)) then
msg.post(“main:/go#loader”, “start_game”)
end
end
if(action_id == hash(“touch”) and action.released == true) then
local textExit = gui.get_node(“exitGame”)
if(gui.pick_node(textExit,action.x,action.y)) then
msg.post("@system:", “exit”, {code = 0})
end
end
end
1 Like