Class CharactersSingleton

Access using Airship.Characters. Characters singleton provides utilities for working with the Character object.

To control your game's default character see CharacterConfigSetup.

Properties

autoDespawnCharactersOnPlayerDisconnect: boolean = true

If true, when a player disconnects their character will automatically be despawned.

autoParentVoiceChatAudioSourceToCharacter: boolean = true

Default: true.

If true, this enables Proximity Voice Chat. The AudioSource is parented to Character and is configured as 3D.

If false, VoiceChatAudioSource will be parented to the Player instead of Character. AudioSource is configured as 2D.

onServerCustomMoveCommand: Signal<CustomMoveData> = ...

SERVER ONLY

[Advanced]

Custom data that the client sends in their move packet.

Methods

  • Observe every character in the game. The returned function can be called to stop observing.

    The observer function is fired for every character currently in the game and every future character that spawns. The observer function must return another function which is called when said character despawned (or the top-level observer function was called to stop the observation process).

    Airship.characters.ObserveCharacters((character) => {
    character.SetMaxHealth(500);
    });

    Parameters

    • observer: ((character) => void | (() => void))
        • (character): void | (() => void)
        • Parameters

          Returns void | (() => void)

    • Optional signalPriority: SignalPriority

    Returns (() => void)

      • (): void
      • Returns void

  • Internal method for spawning a character.

    Parameters

    Returns void