I’ve noticed the new warning for acquire input messages being called multiple times on an object, which is great info!
However, I’ve been trying to fix the warnings, but I’m not sure if I’m doing something wrong or if it’s a bug in the warning.
My structure looks like this:
function init(self)
msg.post("#menu", "async_load")
end
function on_message(self, message_id, message, sender)
if message_id == hash("load_level") then
print("loading level...")
if self.loading_state then
return
end
self.loading_state = hash("loading_screen")
self.loaded_level = message.level
msg.post("#loading", "async_load")
elseif message_id == hash("proxy_loaded") then
print(sender)
msg.post(sender, "enable")
msg.post(sender, "acquire_input_focus")
end
end
So the warning comes from the proxy_loaded case, where it enables the proxy and calls acquire_input_focus which is needed as far as I understood to get the proxy object to start receiving input. The output log looks like this:
DEBUG:SCRIPT: url: [main:/root#menu]
DEBUG:SCRIPT: loading level...
DEBUG:SCRIPT: url: [main:/root#loading]
WARNING:GAMEOBJECT: Input focus already acquired for instance with id: '/root'.
Any pointers to how I can restructure the code to get rid of the warning or is it a bug?