Hello, dear community! It’s me again. At this time I was stuck on reloading scene.
I follow this public example
And I’ve added some changes to reload. Here is my code:
function on_message(self, message_id, message, sender)
if message_id == hash("show_game") then
msg.post("#base_level", "load")
msg.post("#main_menu", "unload")
elseif message_id == hash("reload_game") then
msg.post("#base_level", "unload")
msg.post("#base_level", "load")
elseif message_id == hash("show_menu") then
msg.post("#main_menu", "load")
msg.post("#base_level", "unload")
elseif message_id == hash("proxy_loaded") then
msg.post(sender, "enable")
print('proxy_loaded')
end
end
In the message ‘reload_game’ I’m trying to unload and load my level again
But I got an error
The collection ‘base_level’ could not be created since there is already a socket with the same name.