Game Events

join and leave

These events are triggered when a player or cinema joins or leaves.

In your script, you can enable, listen to and handle the playerJoined the event:

function handlePlayerJoined(event) {
	console.log(event.data.playerID);
}

UB.game.on("playerJoined", handlePlayerJoined);	

Example event

{
	"name":"playerJoined", 
	"data":{"playerID":1}
}