Supported UGS events
Learn about the events emitted by Unity Gaming Services that you can use to trigger Cloud Code scripts or modules.
Read time 6 minutesLast updated 18 hours ago
Unity Gaming Services emit events that can provide you with information about player activity and game state. Use these events to trigger Cloud Code scripts or modules by creating a trigger configuration with the corresponding event type. Refer to Trigger structure to check how an event is matched to the trigger configuration.
Refer to the table below for a list of events emitted by Unity Gaming Services:
Service | Event name | Emitted when |
|---|---|---|
| Authentication | Signed up | A player signs up to the Authentication service. A created player is also signed in, emitting a Signed in event. |
| Authentication | Signed in | A player signs into the Authentication service or refreshes their token. |
| Leaderboards | Reset | A leaderboard resets. |
| Leaderboards | Score submitted | A player submits a score to a leaderboard. |
| Cloud Save | Key saved | A Cloud Save key saves for a player or an entity. |
| Moderation | Player action | A player action is moderated. |
Authentication
The Authentication service provides events that can help you drive engagement for new players, provide sign-in bonuses, and reward returning players. If you are authenticating players from Unity Runtime, the events are fired before the player authentication flow is completed.Signed up
The signed up event is emitted when a player is created in the Authentication service. A created player is also signed in, emitting a Signed in event. Event type:com.unity.services.player-auth.signed-up.v1Field | Description | Type |
|---|---|---|
| An alphanumeric string used to identify returning and new players on different devices and external providers. | string |
| The provider that was used to sign in. | string |
| A timestamp of when the player account was created in the RFC3339 format. | string |
playerIdSigned in
The signed in event is emitted when a player signs into the Authentication service, or refreshes their token. Event type:com.unity.services.player-auth.signed-in.v1Field | Description | Type |
|---|---|---|
| An alphanumeric string used to identify returning and new players on different devices and external providers. | string |
| The provider that was used to sign in. | string |
| A timestamp of when the player account was created in the RFC3339 format. | string |
| A timestamp of when the player last logged in in the RFC3339 format. | string |
| A timestamp of the previous date the player logged in in the RFC3339 format. | string |
playerIdLeaderboards
The Leaderboard service provides events that can help you drive engagement.Reset
The reset event is emitted when a leaderboard is reset. Event type:com.unity.services.leaderboards.reset.v1Field | Description | Type |
|---|---|---|
| The leaderboard ID. | string |
| The leaderboard version ID. | string |
Score submitted
The Leaderboards service emits the score submitted event when a player submits a score to a leaderboard. Event type:com.unity.services.leaderboards.score-submitted.v1Field | Description | Type |
|---|---|---|
| The leaderboard ID to which the score was submitted. | string |
| The timestamp of the score submission in the RFC3339 format. | string |
| The player ID. | string |
| The player name. | string |
| The player's rank. | int |
| The score as it is stored in the leaderboard, which may differ from the submitted value based on the leaderboard's update strategy. | double |
| The player's tier. Empty string for non-tiered leaderboards. | string |
| The bucket ID. Empty string for non-bucketed leaderboards. | string |
Cloud Save
The Cloud Save service provides an event that can help you drive engagement by notifying players when their item is updated.Key saved
The key saved event is emitted when an item of a player or an entity in Cloud Save is saved. Event type:com.unity.services.cloud-save.key-saved.v1Field | Description | Type |
|---|---|---|
| The ID of the player or the entity associated with the event. Corresponds to the | string |
| The item set ID type, | string |
| The key for the Cloud Save item. | string |
| Whether the value for the Cloud Save item is included in the event. Only values under 128b in size are returned. | bool |
| The value for the Cloud Save item. Only values under 128b in size are returned. | object |
| The write lock for the Cloud Save item. | string |
| The access class of the item. This could be | string |
| The item modified date in the RFC3339 format. | string |
Moderation
The Moderation service provides events that can help you manage player behavior. You can define custom actions in Cloud Code to execute when a player action is moderated through the Moderation service. For example, you can define a custom action in Cloud Code to ban a player from a specific game mode when the event is emitted.Player action
The player action event is emitted when a player action is moderated. Event type:com.unity.services.moderation.player-action-event.v1Field | Description | Type |
|---|---|---|
| The UUID of the player action related to the event. | string |
| The UUID of the moderation incident where this player action was applied. | string |
| The type of event associated with the action. The value will be | string |
| The identifier of player action type that is being applied. | string |
| The display name of player action type that is being applied. | string |
| The reason why a player action is being applied or revoked. | string |
| A comment provided by the moderator why the action is being applied or revoked. | string |
| The moderator responsible for this player action. | string |
| The uas ID of the affected player. | string |
| The username of the affected player. If no player name can be retrieved, this value will be populated with the same value as the | string |
| Defines whether this player action is a one-time action. | bool |
| A timestamp of when the player action was created in the RFC3339 format. | string |
| A timestamp of when the player action will expire in the RFC3339 format. Can be null if the player action is a permanent, or a one-time action. | string or null |
| A timestamp of when the player action was revoked in the RFC3339 format. Can be null if the player action has not been revoked. | string or null |
| A map of the player's external IDs. The key is the provider ID and the value is the external ID. | object |