Skip to content

Commit 1706b27

Browse files
Site changes [skip-ci]
1 parent cb19a2b commit 1706b27

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

llms-full.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6004,6 +6004,22 @@ msg.post("main:/loader#script", "load_level", { level_id = 2 })
60046004

60056005
![load](https://defold.com/manuals/images/collection-proxy/message_passing.png)
60066006

6007+
And if you need to communicate with a game object in the loaded collection from the loader you can send a message using the [full URL to the object](#manuals:addressing):
6008+
6009+
```lua
6010+
msg.post("mylevel:/myobject", "hello")
6011+
```
6012+
6013+
<div class='important' markdown='1'>
6014+
It is not possible to directly access game objects in a loaded collection from outside of the collection:
6015+
6016+
```lua
6017+
local position = go.get_position("mylevel:/myobject")
6018+
-- loader.script:42: function called can only access instances within the same collection.
6019+
```
6020+
</div>
6021+
6022+
60076023
## Unloading a world
60086024

60096025
To unload a loaded collection, you send messages corresponding to the converse steps of the loading:

manuals/collection-proxy.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@ msg.post("main:/loader#script", "load_level", { level_id = 2 })
9696

9797
![load](../images/collection-proxy/message_passing.png)
9898

99+
And if you need to communicate with a game object in the loaded collection from the loader you can send a message using the [full URL to the object](/manuals/addressing/#urls):
100+
101+
```lua
102+
msg.post("mylevel:/myobject", "hello")
103+
```
104+
105+
<div class='important' markdown='1'>
106+
It is not possible to directly access game objects in a loaded collection from outside of the collection:
107+
108+
```lua
109+
local position = go.get_position("mylevel:/myobject")
110+
-- loader.script:42: function called can only access instances within the same collection.
111+
```
112+
</div>
113+
114+
99115
## Unloading a world
100116

101117
To unload a loaded collection, you send messages corresponding to the converse steps of the loading:

0 commit comments

Comments
 (0)