Alright so I have tried my best researching in the manuals and API references. I could completely over looking what it is I’m messing up on.
Here is my hierarchy:
main.collection
– level_proxies (GO)
– main_menu (GUI)
level1.collection
– camera (GO)
– level1_world (GO) includes tilemap
– player (GO)
– spider (GO)
– spider1 (GO)
From my gui_script when the level1 button is pressed it sends this code, and waits for response
main_menu.gui_script
function on_message(self, message_id, message, sender)
if message_id == hash("proxy_loaded") then
msg.post(".", "disable")
msg.post(".", "unload")
msg.post(sender, "init")
msg.post(sender, "enable")
end
end
function on_input(self, action_id, action)
msg.post(".", "release_input_focus")
msg.post("main:/level_proxies#level" .. i .. "proxy", "load")
end
player.script
function init(self)
-- Some custom variables here
msg.post(".", "acquire_input_focus")
end
Everything loads perfectly, level loads up and all scripts are running. However no input I do is sent to the player script or the gui_script.
Before I started working on the gui and collection proxy everything worked, input and all. Somewhere in the script input is lost and i cant seem to get it back.
My question is, am I sending the right messages to the proxy to do a proper transition or am I missing something somewhere?