Call gameobject with different proxy

Hello

Like my title, is possible to call gameobject with a different proxy?

So I have 3 collections

  1. game collection ~ game start here
  2. menu collection ~ the menu
  3. all collection ~ which is game collection and menu collection is called from proxy

Screenshot 2021-08-17 164747

so I want to call the camera gameobject from the game collection script. Basically, I want to change the camera gameobjects position. is that possible?

anyway I have github page for the game project https://github.com/reopucino/defold_tap_animals

Hey
I don’t know if this is what you want but you can pass message over “game worlds”. For example, you have an enemy on the “battle.collection” that hits the player and it needs to inform that to the gui (that probably is on another world like “main”).

msg.post("main:/hud#battle_gui", "update_score", { damage = self.damage})

for you camera example you can use the message to pass the new target hash or the new position.

More info here:

1 Like

You are not able to use any of the go.* functions from one loaded collection (via a collection proxy) to manipulate game objects in another loaded collection. The game objects exist in separate “worlds”, just like @Dat_Indie explains above. Message passing is the way in which you communicate between worlds.

2 Likes

ah okey2, thanks @Dat_Indie and @britzl for the answer.