Collection proxy trouble

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!

I can’t spot any mistake, assuming your URLs are correct.
Mind sharing a project zip?

1 Like

Update: it is loading the collection but for some reason just showing a black screen, i have tried with other collections and they load but still just show a black screen. it seems to only be doing it from that point

sure!

All fixed, turns out i still had a camera acquiring focus so the proxy was loading i just couldnt see it as the camera was set to the wrong position. Although the camera was in the unloaded proxy so does that mean cameras dont ulnoad with the colections?

A camera component sends a view and projection matrix to the render script each frame, and the render script will use the most recently received view and projection when drawing. This means that even if you unload the collection with the camera the render script will still remember the most recent view and projection and continue to use that.

1 Like

ah that helps alot, thank you