I am trying to unload my menu collection by sending a message “killmenu” to a script however whenever I run the code I get an error: “Component ‘/go#loader’ could not be found when dispatching message ‘killmenu’ sent from menu:/main_menu#menu”
Does anyone know what I have done wrong? thanks
Code in my gui script:
if action_id == hash("touch") and gui.pick_node(self.button, action.x, action.y) then
msg.post("go#loader", "killmenu")
msg.post("level_loader#level_loader_script", "load")
end
Code in the loader script:
function init(self)
msg.post(".", "acquire_input_focus")
msg.post("#collectionproxy", "load")
msg.post("#collectionproxy", "init")
msg.post("#collectionproxy", "enable")
end
function on_message(self, message_id, message, sender)
if message_id == hash("killmenu") then
msg.post("#collectionproxy", "unload")
end
if message_id == hash("proxy_loaded") then
msg.post(sender, "init")
msg.post(sender, "enable")
end
end