OK, the first thing I notice, in your game.project, under Bootstrap >> Render, you’re not using the RenderCam render script. RenderCam won’t work at all unless you hook that up. That may not be the cause of the error though, so I left that for now.
If I open your ‘boop.script’ and remove the ‘rendercam.follow("boop:/boop")
’ line, then the project runs with no errors, so we know it has something to do with that.
If instead I add a line:
msg.post(“boop:/boop”, “test”)
I get the following error:
ERROR:SCRIPT: /main/boop.script:9: Could not send message ‘test’ from ‘default:/boop#boop’ to ‘boop:/boop’.
Not the most descriptive error message, but this means there’s something wrong with our “boop:/boop” URL. Also it tells us that the URL of the boop.script instance is “default:/boop#boop”…
(You can also use ‘print(msg.url())
’ in a script to find out its URL.)
If you open ‘collection.collection’ and click on the root “node” in the Outline panel, you’ll see in its properties that its name is “default” (not “boop”). You may want to change this.
If you look at the addressing manual, it says the URL format is:
[socket:][path][#fragment]
The ‘socket’ part is the “world” collection that the object is in. Normally this is your “main” collection (or whatever you have called it) for everything, but if you use collection proxies, it will be the name of your proxy collection (for objects inside that collection).
The ‘path’ part is the hierarchy of collections that the object is in, inside the world collection. Note: this is NOT the hierarchy of game objects. If you do something like this:
The URL path will still just be ‘/boop
’ (as you can see in the properties panel). All game objects in the same collections must have unique names for this reason. Instead, if you add Collections (in separate files) that are nested, one inside the other, with ‘boop.go’ inside the last one, you will get this:
You can see in the properties panel that the URL path changes.
So, anyway…If you change your boop script to use ‘rendercam.follow("default:/boop")
’, then you don’t get any errors. Do that and hook up the render script in your game.project, and it should work just fine.
A slightly better idea though, is to use ‘rendercam.follow(msg.url("."))
’. The 'msg.url(".")'
gives you the address to the current game object (without the “fragment”/component), which is what RenderCam needs for following. This way you don’t even need to know the URL, you change change things around however you want and it will still work.
There is a limitation, as your original error suggests, that you can’t get the position of an object in a different world. So, if you had your camera in main.collection, it could not follow objects in your proxy world, you would need to use another camera inside the proxy collection.