IAvatarService
public interface IAvatarServiceNamespace NodeWorld.Core.
Loads and shows the avatars: the local player's and those of the other players.
Properties
HasLocalAvatar
bool HasLocalAvatar { get; }The local player has an avatar.
Methods
SetRemoteAvatarAudible
void SetRemoteAvatarAudible(uint playerId, bool audible)Mutes or unmutes, for the local player only, every AudioSource of that remote player's avatar (kept across avatar changes).
LoadPlaceholder
void LoadPlaceholder()Shows the default avatar while the player's own loads.
LoadAvatar
void LoadAvatar(string avatarId)Loads the local player's avatar avatarId and puts it on.
ClearAvatar
void ClearAvatar()Removes the local player's avatar.
TeleportLocalAvatar
void TeleportLocalAvatar(Vector3 position, Quaternion rotation)Moves the local player's avatar to position, facing rotation.
SetSeatedMode
void SetSeatedMode(bool seated)Turns seated mode on or off for the local player's avatar.
SpawnRemoteAvatar
UniTask SpawnRemoteAvatar(uint playerId, string userId, string displayName, string avatarId, string platform)Spawn a remote player's avatar, using the placeholder while custom assets load.
SwapRemoteAvatar
UniTask SwapRemoteAvatar(uint playerId, string avatarId)Swap an existing remote player's avatar.
DespawnRemoteAvatar
void DespawnRemoteAvatar(uint playerId)Despawn a remote player's avatar.
DespawnAllRemoteAvatars
void DespawnAllRemoteAvatars()Despawn all remote avatars (e.g. on disconnect or world change).
GetRemoteAvatarTransform
Transform GetRemoteAvatarTransform(uint playerId)Returns the root Transform of a remote player's avatar, or null if not found.
GetRemoteAvatarVoiceTransform
Transform GetRemoteAvatarVoiceTransform(uint playerId)Returns the preferred voice origin for a remote player, usually near the head/mouth.
FeedLocalVisemePcm
void FeedLocalVisemePcm(float[] pcm, int sampleCount, int channels)Feed raw local microphone PCM to the active local avatar viseme driver.
FeedRemoteVisemePcm
void FeedRemoteVisemePcm(uint playerId, float[] pcm, int sampleCount, int channels)Feed decoded remote player PCM to that player's avatar viseme driver.
UpdateRemotePlayerState
void UpdateRemotePlayerState(uint playerId, Vector3 position, Quaternion rotation, Vector3[] bonePositions, Quaternion[] boneRotations)Update a remote player's full pose from network state.
CaptureLocalBoneSnapshot
BoneSnapshot CaptureLocalBoneSnapshot()Capture the local player's current bone world-space transforms. Returns an invalid snapshot if no local avatar is active.
Events
OnLocalAvatarReady
event Action OnLocalAvatarReadyRaised when the local player's avatar is loaded and shown.
OnRemoteAvatarSpawned
event Action<uint> OnRemoteAvatarSpawnedRaised when another player's avatar is shown (their player ID).
OnRemoteAvatarDespawned
event Action<uint> OnRemoteAvatarDespawnedRaised when another player's avatar is removed (their player ID).
