Colorslide level GUI doesn't disappear?

Hello, I was trying to complete the Colorslide tutorial and at the end, when I loaded the game with the final changes made, the start screen displayed both the start gui and the level gui, like this:

also, if Ipress the back button, this shows up:

ERROR:GAMEOBJECT: Component '/loader#proxy_level_0' could not be found when dispatching message 'disable' sent from default:/loader#loader
ERROR:GAMEOBJECT: Component '/loader#proxy_level_0' could not be found when dispatching message 'final' sent from default:/loader#loader
ERROR:GAMEOBJECT: Component '/loader#proxy_level_0' could not be found when dispatching message 'unload' sent from default:/loader#loader

If I had selected a level before pressing the button, the number changes according to the level, so if I select level 2 for example, the error is the following:

ERROR:GAMESYS: The collection /main/level_2/level_2.collectionc could not be disabled since it is not enabled. Message 'disable' sent from default:/loader#loader to default:/loader#proxy_level_2.
ERROR:GAMESYS: The collection /main/level_2/level_2.collectionc could not be finalized since it was never initialized. Message 'final' sent from default:/loader#loader to default:/loader#proxy_level_2.
ERROR:GAMESYS: The collection /main/level_2/level_2.collectionc could not be unloaded since it was never loaded. Message 'unload' sent from default:/loader#loader to default:/loader#proxy_level_2.

Despite the errors, the back button still works. If I press it on the start screen, the level select buttons join the party, like this:

Any ideas on what could have gone wrong?? The level.gui_script is the following btw:

	if message_id == hash("level_completed") then                       -- [1]
		local done = gui.get_node("done")
		gui.animate(done, "position.x", 320, gui.EASING_OUTSINE, 1, 1.5)
	end
end

function on_input(self, action_id, action)                              -- [2]
	if action_id == hash("touch") and action.pressed then
		local back = gui.get_node("back")
		if gui.pick_node(back, action.x, action.y) then
			msg.post("default:/guis#level_select", "show_level_select")  -- [3]
			msg.post("default:/loader#loader", "unload_level")
		end

		local next = gui.get_node("next")
		if gui.pick_node(next, action.x, action.y) then
			msg.post("default:/loader#loader", "next_level")            -- [4]
		end
	end
end

Hi! I went through the full tutorial and made all the changes required to reach the end of the tutorial. The updated version of the project can be found in the tutorial-done branch:

Full project as zip: https://github.com/defold/tutorial-colorslide/archive/refs/heads/tutorial-done.zip

In the Level Selection section of the tutorial you send a load_level message from the level_select.gui_script:

msg.post("/loader#loader", "load_level", { level = n })

And in the loader.script you handle this message:

function on_message(self, message_id, message, sender)
    if message_id == hash("load_level") then
        local proxy = "#proxy_level_" .. message.level

So in your case something is wrong with message.level.

I think you need to go over everything and compare with the completed tutorial project that I shared.

2 Likes

Hey, so, I think I figured out what the problem was. I put the level.gui file into the main.collection’s guis game object because I thought they were all supposed to go in there… I took it out of there and it seems to have solved the problem with no other losses that I am aware of. Thank you so much for your help! :smiley:

2 Likes