I’m testing out collection proxies before using them in my game, and I’m having an issue with it crashing when I try to load multiple proxies.
I’ve got a ‘game’ collection, and a ‘menu’ collection, both loaded through proxies.
Then the menu collection loads a further 4 proxies for screens. So 6 in total.
Currently each of these proxies is just a collection with an empty game object in it, so they aren’t very big. Except for game, but I still get the crash even if this collection isn’t loaded.
But the trouble I’m having is that it crashes if I try to load all of them at once, if I comment a few out, it loads ok. I’m getting the ‘Physics world buffer full, world could not be created’ error, but changing my max collection proxies in my config hasn’t made any difference.
All the collections have unique names.
Here’s my code for the preloader
function init(self)
-- load our game collection(s)
msg.post("game_pxy", "load")
msg.post("menu_pxy", "load")
end
function on_message(self, message_id, message, sender)
-- Init and Enable them then they've been loaded
if message_id == hash("proxy_loaded") then
print("" .. tostring(sender) .. " has loaded")
msg.post(sender, "init")
msg.post(sender, "enable")
end
end
and the menu loader
local to_load = {}
to_load[0] = "#gameover_pxy"
to_load[1] = "#settings_pxy"
to_load[2] = "#store_pxy"
to_load[3] = "#title_pxy"
local count = 1
function init(self)
print("preloading menu screens...")
msg.post(to_load[0], "load")
end
function on_message(self, message_id, message, sender)
if count > 3 then return end
if message_id == hash("proxy_loaded") then
print("" .. tostring(sender) .. " has loaded")
msg.post(sender, "init")
msg.post(sender, "enable")
msg.post(to_load[count], "load")
count = count + 1
end
end