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 aRapportPlayerand 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 optionalVector3to 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 optionalVector3to define the scaling factor for the model. Defaults to(-.01f, .01f, .01f).
Returns:
bool: Returnstrueif the player binding was successful, andfalseotherwise.
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 aRapportPlayerfor 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 optionalVector3for model orientation adjustments.Vector3? scaleOffset: An optionalVector3for model scaling adjustments.
Returns:
bool: Returnstrueif the player binding was successful, andfalseotherwise.