Hey,
So I have a situation where I have a main menu and a level select. I have got it so that when you click play it takes you to the level select, this is working fine using a msg.post to a controller script. The problem occurs when I try to go back to the main menu, I am using the same receiver url from the main menu to controller as from level select to controller. The only difference is that the controller and main menu are in the same collection whereas the controller and level select are in different collections. The 2 collections are Main.collection and Level Select.collection. The error message I get is:
ERROR:GAMEOBJECT: Instance ‘/Main’ could not be found when dispatching message ‘main menu’ sent from default:/go#Level Select
Is there something else I have to add to the receiver url when addressing a script in a different collection?
if action_id == hash("touch") and action.pressed then
local button = gui.get_node("Exit")
if gui.pick_node(button, action.x, action.y) then
msg.post("/Main#Main", "main menu")
end
end
Here is the code receiving the message main menu:
if message_id == hash("main menu") then
msg.post("/Main#Main Menu", "enable")
msg.post("/Main#Level Select", "unload")
I still get this error when I run the program:
ERROR:GAMEOBJECT: Instance ‘/Main’ could not be found when dispatching message ‘main menu’ sent from default:/go#Level Select
Both the collections involved are named Main and Level Select