Skip to main content
Skip table of contents

BindPlayer

The BindPlayer method initializes a RapportPlayer instance and connects it to the appropriate components for audio and animation. This method should be called only after the session has been successfully started and is ready.

BindPlayer(AudioSource outputAudioSource, Animator animator, Vector3? RotationOffset = null, Vector3? ScaleOffset = null)

  • Description: This is a convenience overload designed for typical AI-driven Rapport sessions where the client ID is assumed to be 0. It creates a RapportPlayer and sets up the necessary components.

  • Parameters:

    • AudioSource outputAudioSource: An audio source component that will be used to play the voice and audio output of the Rapport character. Note that this audio source component should be on a different component than the one used for microphone input.

    • Animator animator: An animator component that will serve as the output node for the Rapport animation playable graph. Note that this animator needs an attached animator controller to work.

    • Vector3? RotationOffset: An optional Vector3 to define the model's default orientation. Useful for correcting rotation differences from various 3D applications. Defaults to (1, -1, -1), which is common for left-handed coordinate systems.

    • Vector3? ScaleOffset: An optional Vector3 to define the scaling factor for the model. Defaults to (-.01f, .01f, .01f).

  • Returns:

    • bool: Returns true if the player binding was successful, and false otherwise.

BindPlayer(int id, AudioSource outputAudioSource, Animator animator, Vector3? rotationOffset = null, Vector3? scaleOffset = null)

  • Description: This is the primary implementation of BindPlayer. It creates and initializes a RapportPlayer for a specific client ID, setting up its audio and animation.

  • Parameters:

    • int id: The client ID of the player to bind to the session.

    • AudioSource outputAudioSource: An audio source component for character voice and audio output.

    • Animator animator: An animator component for character animations.

    • Vector3? rotationOffset: An optional Vector3 for model orientation adjustments.

    • Vector3? scaleOffset: An optional Vector3 for model scaling adjustments.

  • Returns:

    • bool: Returns true if the player binding was successful, and false otherwise.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.