Access core properties of the currently running game instance.

Properties

gameId: string

While in editor, this will reflect whatever is defined in Assets/GameConfig.asset

localPlayer: Player = ...

The local client's player.

On the server this is undefined.

There is a brief moment on client startup when localPlayer is undefined. You can listen for when the local player is loaded with WaitForLocalPlayerLoaded

onMenuOpened: Signal<[opened: boolean]> = ...

Fired when the local player opens the Main Menu (escape key).

You can also use () to check if opened.

Deprecated

use Airship.Menu.onMenuOpened instead

organizationId: string

Empty string when in editor.

platform: AirshipPlatform = ...

The platform of this device.

To get a certain player's platform, use Player.platform

playerFlags: Set<string> = ...

List of Airship client feature flags enabled on this player.

playerVersion: number = 16

The local player's client version number.

serverId: string

Empty string when in editor.

Methods

  • Returns boolean

    True if this game instance is acting as a player client. When published this will be true for all players. In local development in Shared Server Mode this will also be true (because the client is operating as both server and client).

  • Shortcut for checking if both IsClient() and IsServer() is true.

    Returns boolean

  • Used to check if the Airship Escape Menu is opened.

    Returns boolean

    True if the Airship Escape Menu is open.

    Deprecated

    Use Airship.Menu.IsMenuOpen() instead.

  • Returns true if device is a phone or tablet.

    Returns false if on desktop or console.

    Returns boolean

  • Returns boolean

    True if this game instance is acting as the server. When published this will only be true on the game server. In local development in Shared Server Mode this will also be true (because the client is operating as both server and client).

  • Yields until Game.gameData has been loaded.

    Returns PublicGameWithOrg