Class AirshipCharactersSingleton

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.

instantiateViewmodel: boolean = true

If true, a character viewmodel will be instantiated as a child of the ViewmodelCamera

onViewModelUpdate: Signal<[viewmodelTransform: Transform]> = ...

Fires before view model updates with position and rotation. Change these values to adjust view model position.

Transform is the Spine Transform.

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