Hi,
I’ve recently been working on a game inspired by the gym. I have been making use of collection proxies to load and unload my scenes. They have been working absolutely fine up until this point. But when try and load ‘benchgame’ it results in a black screen.
–This is how i load and unload my proxies…
--This is how i load and unload my proxies..
function init(self)
msg.post(".", "acquire_input_focus")
self.CurrentProxy = nil
msg.post("#", "show_main")
end
local function show(self, proxy)
if self.CurrentProxy then
msg.post(self.CurrentProxy, "unload")
self.CurrentProxy = nil
end
msg.post(proxy, "async_load")
end
function on_message(self, message_id, message, sender)
if message_id == hash("show_main") then
show(self, "#initial")
elseif message_id == hash("BeginGame") then
show(self, "#game")
elseif message_id == hash("Loading") then
show(self, "#loading")
elseif message_id == hash("BenchGame") then
show(self, "#BenchGameProxy")
elseif message_id == hash("proxy_loaded") then
self.CurrentProxy = sender
msg.post(sender, "init")
msg.post(sender, "enable")
print("loaded", sender)
elseif message_id == hash("proxy_unloaded") then
print("Unloaded", sender)
end
end```
--which is working fine until i try to load "bench game". I have checked numerous times and everything is set up the same.
--This is the code sending the message to this script.
```lua
local function countdown(self, handle)
local count = gui.get_node("countdown")
self.counter = self.counter -1
gui.set_text(count, self.counter)
if self.counter == 0 then
timer.cancel(handle)
msg.post("controller:/controller#proxyhandler", "BenchGame")
end
end
I have tried sending the same message from here but to load other proxies instead of “BenchGame” and it still results in blank screen.
There are no errors in the log.
Any help would be appreciated!