Voltaia
Voltaia2mo ago

Disable Local XR Avatar

It would be nice if there was a tick box to not create a local avatar. If you try to disable the local avatar (destroying or setting inactive) other avatars do not work for some reason. My current solution is looping through the renderers in the local avatar and disabling those. This is a useful feature in the case you want: - Your local player to be independent from the avatar system. I wanted models on my local player prefab so that they are visible in single player without the avatar manager. - Also, it's useful to only have one player 1 running around the scene in multiplayer, instead of one bodyless player 1 and one avatar for player 1. - Finally, I might want different models on avatars than I have on the local player. For instance, if I animate the controller's sticks and buttons on the player, but only want a static model for their avatar. Cheers!
10 Replies
maxweisel
maxweisel2mo ago
ooooh this is a good one
Voltaia
Voltaia2mo ago
Oh, please. You'll make me blush.
maxweisel
maxweisel2mo ago
fwiw your approach is correct bc you still need RealtimeComponents to send their state but we can probably make this easier
Voltaia
Voltaia2mo ago
Sweet!
Andrei Vaduva
Andrei Vaduva2mo ago
I managed to do this, you can set the "manifestation" from half to none on the local avatar prefab On the other hand, i needed to set the remote avatar on a different layer.. well, that took some tinkering, but fwiw, you can attach to all avatar events and run a recursive layer change on all children. That would be a nice feature, to spawn avatars on different layers 🙂
Voltaia
Voltaia2mo ago
Another nice thing would be if it didn’t silently fail when attempting to destroy or set active to false. An error would have helped me troubleshoot I needed a different approach a good bit quicker.
maxweisel
maxweisel2mo ago
how do you mean? what silently fails within Normcore?
Voltaia
Voltaia2mo ago
The avatars stop working completely if you destroy or set active false the local one without throwing any errors Which is fine, I'm sure there's a good reason for that, but an error would have helped me troubleshoot that
maxweisel
maxweisel2mo ago
ah I see what you mean. I’ll look into it.
Horse Eater Beater
There's a very simple fix to this, just add a component that detects whether or not it is the local client and if it is just disable your mesh renderer