(Solved) No updates and visuals after collectionproxy load/init/enable

Hello.
Please help me with collection proxies.
My main scene is:
ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅

Game script is:

function init(self)
	-- Show title screen
	local proxy = msg.url("#cp_title")
	msg.post(proxy, "load")
	msg.post(proxy, "init")
	msg.post(proxy, "enable")
end

In my title collection I created an object with big sprite and the following script attached:

function init(self)
	local x = 45
end

function fixed_update(self, dt)
	local x = 45
end

function update(self, dt)
	local x = 45
end

I placed breakpoint on each β€œx=45” line, but for some reason only first one (from init function) fires, and the screen is completely black with no big sprite attached to object that should be visible. Am I missing something?
Defold version is
ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅

Thanks.

I have no idea why, but suddenly after many rebuildings it started working with no changes in my project.

Ok, so, in previous version of my project sys object was self deleting in init function

function init(self)
    ...
   go.delete()
    ...
end

Idk, maybe it was cached or something like that. With no self deleting it works ok.

You need to wait for it to load.

1 Like