Change the Local Prefab Avatar
In the Realtime Avatar Manager class, how do I change the Local Prefab Avatar at runtime?
localAvatarPrefab property from your own scripts. This property represents the avatar prefab that is instantiated to represent the local client. localAvatarPrefab property of the to the .RealtimeAvatar component on the root in order to function correctly.newAvatarPrefabnewAvatarPrefabChangeAvatar_managerpublic class MyAvatarManager : MonoBehaviour {
private RealtimeAvatarManager _manager;
public GameObject newAvatarPrefab; // Your new avatar prefab
private void Awake() {
_manager = GetComponent<RealtimeAvatarManager>();
}
private void ChangeAvatar() {
_manager.localAvatarPrefab = newAvatarPrefab;
}
}