Forum Discussion

scarcesoft's avatar
scarcesoft
MHCP Partner
5 months ago

Teams API issues


The following snippet:

```

this.world.team.createTeamGroup(teamGroupName);

    this.world.team.createTeam("1", teamGroupName);

    this.world.team.createTeam("2", teamGroupName);

    const teamNames = this.world.team.getTeamNames(teamGroupName);

    console.log("Teams created", teamNames);
```

Always logs `undefined` within a server script. I have tried with both an explicit group and no group, but can't seem to be able to create teams. Also, the signature of the `getTeamNames` function says it returns an array of strings, so this shouldn't be logging `undefined` even if no teams were successfully created. Is there something special I need to do with my world to enable the teams API? It's a brand new world. 

Not sure if related, but I did notice that the documentation for some of these functions seems to have its wires crossed in places. "create" functions say they delete and vice versa:

https://developers.meta.com/horizon-worlds/learn/documentation/typescript/api-references-and-examples/Teams-api

2 Replies

    • Stephen.S's avatar
      Stephen.S
      MHCP Partner

      I have spoken with SeeingBlue, whos original code (on metas website) no longer works. Even creating from scratch.

      I have raised a case on Zendesk, i suggest you do the same and lets hope this gets addressed