ERROR:SCRIPT: /game/scr/player.script:143: Could not send message 'unload_level' from 'level1:/player#player' to 'main:/loader#controller'.
stack traceback:
[C]: in function 'post'
/game/scr/player.script:143: in function </game/scr/player.script:141>
The message sends the object to the player in the collection level:
I am pretty sure you are not sending that message to the right place. Unload messages need to be sent to a collectionproxy, and you are sending it to a script. Look here:
ERROR:SCRIPT: /game/scr/player.script:143: Could not send message 'unload_level' from 'level1:/player#player' to 'main:/loader#controller'.
stack traceback:
it says you’re sending the message to “main:/loader#controller” which is a script. Try sending it to “main:/level/level1”.
But i want to send message from player, wich die to controller, to make proxy reload. Anyway, i’m trying to send message to “main:/level#level1”. It’s the same error.
Well, as @88.josh writes, you need to post the “unload” message to the collection proxy if it is supposed to unload. What you typically do is to have a controller script somewhere that orchestrates the loading and unloading of collection proxies based on state and all messages to load and unload go via that controller script. You can take a look at the recently added color-slide tutorial for an example: https://github.com/defold/tutorial-colorslide or this example with a menu and a “game” that is loaded/unloaded via a controller: https://github.com/britzl/publicexamples/tree/master/examples/menu_and_game