Failed to call msg.post, Could not send message from ... to

Hi!

I have a window collection (hierarchy)

And main map collection. Windows creates by factory in loader.collection. And now I’m trying to show my window and send message
luax.msg.safe_post(“map:/GUI”, “hide_interface”, params)

And have an error
Failed to call msg.post, Could not send message ‘show_interface’ from ‘loader:/collection2/window#window_notification_test’ to ‘map:/GUI’.

Why this error appears?
Thanks!

Is it because you are not sending to target script with #script in url e.g. “map:/GUI#ScriptName” ?

Are you absolutely sure that there is a loaded collection with name map that in its root has a game object with id GUI?

The screenshot you shared does not matter much. You can post messages from anywhere in your game to any other place. What matters in this case is that there doesn’t seem to be a destination map:/GUI at the moment when the message is sent.

Check the docs on addressing if you are unsure of how the URLs are composed and how absolute vs relative URLs work (Addressing in Defold)

Thank you for your reply!
About “map:/GUI” - it cannot be problem, cause function which sending this message exists for many years and work with all windows… If problem was here the game would have been broken :frowning: So it should be somewhere in window_notification_test…

Hmm, I don’t think so, but maybe. I can take a closer look since I believe I have access to the project you are working on. Could you please send an email to bjorn@defold.se and we’ll continue there?

1 Like