How to see other people’s cosmetics

I have a problem. Where if someone enables a cosmetic. It doesn’t appear to other people. How do you fix it
3 Replies
kapa.ai
kapa.ai9mo ago
Hi @Myles/Jayme/Ziporded. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. However, in NormalVR, you can use the RealtimeAvatarManager to keep track of avatars that were instantiated for other players in the same room. This component is responsible for instantiating an avatar prefab to represent the local player as well as keeping track of avatars that were instantiated for other players in the same room. If you would like to use a different avatar prefab for different clients, this property can be changed at runtime from your own scripts. In addition to managing the local player prefab instance, RealtimeAvatarManager keeps track of all avatars in the room via the localAvatar and avatars properties. The latter is a dictionary of all RealtimeAvatar components stored under the clientID that the avatar belongs to. This can be useful for determining how many players are currently in a multiplayer space. Here is a code snippet on how to use RealtimeAvatarManager:
using UnityEngine;
using Normal.Realtime;

public class MyAvatarManager : MonoBehaviour {
private RealtimeAvatarManager _manager;

private void Awake() {
_manager = GetComponent<RealtimeAvatarManager>();
_manager.avatarCreated += AvatarCreated;
_manager.avatarDestroyed += AvatarDestroyed;
}

private void AvatarCreated(RealtimeAvatarManager avatarManager, RealtimeAvatar avatar, bool isLocalAvatar) {
// Avatar created!
}

private void AvatarDestroyed(RealtimeAvatarManager avatarManager, RealtimeAvatar avatar, bool isLocalAvatar) {
// Avatar destroyed!
}
}
using UnityEngine;
using Normal.Realtime;

public class MyAvatarManager : MonoBehaviour {
private RealtimeAvatarManager _manager;

private void Awake() {
_manager = GetComponent<RealtimeAvatarManager>();
_manager.avatarCreated += AvatarCreated;
_manager.avatarDestroyed += AvatarDestroyed;
}

private void AvatarCreated(RealtimeAvatarManager avatarManager, RealtimeAvatar avatar, bool isLocalAvatar) {
// Avatar created!
}

private void AvatarDestroyed(RealtimeAvatarManager avatarManager, RealtimeAvatar avatar, bool isLocalAvatar) {
// Avatar destroyed!
}
}
For more information, you can refer to the RealtimeAvatarManager documentation (https://normcore.io/documentation/realtime/xr/avatars#realtimeavatarmanager). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@911443990715457576> kapa.ai is still learning and improving, please let us know how it did by reacting below
liamc
liamc9mo ago
It depends on your avatar setup and the type of cosmetics. The simplest implemenation, if you just want to give a player a hat, would probably be for the player to Realtime Instantiate a hat prefab with a RealtimeTransform on it. Otherwise, for more complex avatars and cosmetics you probably want to write a custom model to sync cosmetic IDs, colours, maybe positions, etc. Then each player would locally spawn the prefabs/textures for each avatar's cosmetics. E.g: Here's my custom avatar's realtime model:
No description

Did you find this page helpful?