Ryllexya
Ryllexya3mo ago

Is there a way to make my own avatar invisible to myself but keep it visible for others?

I've tried some to apply so easy stuff that I could think of - turning off rendering, not displaying that layer on my own camera - but it seems like the issue isnt the fact I need to find an avatar owned by me to do this, but how do I apply something like this without replicating it to others.
5 Replies
kapa.ai
kapa.ai3mo ago
Hi @Ryllexya. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, you can make your own avatar invisible to yourself but keep it visible for others in NormalVR. This can be achieved by disabling the rendering of the avatar on your local client while keeping it enabled for other clients. However, you need to be careful not to replicate this change to other clients. In NormalVR, changes made to a RealtimeView or RealtimeComponent owned by a client are typically replicated to other clients. This is why when you tried to turn off rendering or not display that layer on your own camera, it affected other clients as well. To avoid this, you can make use of the isOwnedLocallyInHierarchy property. This property can be used to check if a RealtimeView is owned by the local client. If it is, you can then disable the rendering of the avatar for that client only. Here's a simple example of how you can do this:
if (realtimeView.isOwnedLocallyInHierarchy) {
// This is the local client's avatar
GetComponent<Renderer>().enabled = false;
}
if (realtimeView.isOwnedLocallyInHierarchy) {
// This is the local client's avatar
GetComponent<Renderer>().enabled = false;
}
In this code, realtimeView is the RealtimeView component of the avatar. The GetComponent<Renderer>().enabled = false; line disables the rendering of the avatar, making it invisible. Remember to place this code in a script that is attached to your avatar prefab and runs only on the local client's instance of the prefab. This way, the change will not be replicated to other clients, and the avatar will remain visible to them. For more information on how ownership works in NormalVR, you can refer to the Ownership section of the Normcore documentation (https://normcore.io/documentation/room/ownership-and-lifetime-flags#how-ownership-is-enforced). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@164038313924231178> kapa.ai is still learning and improving, please let us know how it did by reacting below
Ryllexya
Ryllexya3mo ago
Just had a chance to try this out. This worked like magic! Thank you, good bot! 🙂
Michał Wróblewski
I've got some additional notes based on my experience with avatars. Normcore got a nice RealtimeAvatarManager example you can look at. It shows how you can customize behaviour at setup of a local avatar with CreateAvatarIfNeeded() as a factory method (customize when Avatar is created locally). You can also customize local behaviour in RealtimeAvatar which is a RealtimeComponent class. You can customize at setup SetLocalPlayer() and on update in UpdateAvatarTransformsForLocalPlayer(). In RealtimeAvatar you need to make sure it's a local instance (if (_localPlayer != null)) because it exists in every Avatar instance local and remote. Also if you're interested in Meta Avatars I'd wait for Normal official sample that should appear this week.
Ryllexya
Ryllexya3mo ago
Thank you for the extra info!