Hello again!
We noticed, that if we create a networking-session in VR, sometimes the head-model of other avatars in the room room is missing. Their hands are always visible, but the head is missing sometimes. Sometimes some user see the heads of others, but other user in the same session not.
Is there a way to change this behavior or improve the chances, that the head will be visible?
The only difference between the hands and the head is that they have different XR Flags, but they seem to make sense to me, since I don’t want to see my head from the first person view
Hello there – we have an experimental AI bot that might be able to help you with your question. Would you like to try this out?
How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.
The issue with the head-model of avatars sometimes being invisible in a VR networking session could be related to the XRFlag component, which controls visibility based on the XR state. If the head and hands have different XRFlag settings, they might behave inconsistarily depending on the session’s state. To ensure consistent visibility, you could consider updating the visibility manually, particularly when the session state changes or in the awake, onEnable, and UpdateVisible methods of the XRFlag component (see the documentation).
Here is a simplified pseudocode to show you how you could approach updating the visibility manually:
In the awake or onEnable method of your avatar component, check the current XR state.
According to the current state, update the visibility of the head and hands using the UpdateVisible method of XRFlag.
Listen for any changes in the XR state and update the visibility accordingly.
class YourAvatarComponent extends Behaviour {
// ...
awake() {
// Check the XR state and update visibility
this.updateAvatarVisibility();
}
updateAvatarVisibility() {
let xrState = XRState.Global; // Get the global XR state
// Suppose your head has a flag called headXRFlag and hands handsXRFlag
this.headXRFlag.UpdateVisible(xrState);
this.handsXRFlag.UpdateVisible(xrState);
}
// ...
}
You would need to replace the placeholders with actual references to the XRFlag components on your head and hands. Also, make sure to handle state changes and call updateAvatarVisibility appropriately when they occur.
Please modify the steps above to fit your project’s structure and naming conventions.
Our quick fix: We set the XR state of the head model to everything. This means that we can see our own head. But if you set the material’s render face to front, the head will no longer be rendered in our field of view.
@herbst🌵 yes, I guess especially the “first person” XRFlag.
Unfortunately our workaround with one-sided materials did not work well (to hide the nose we had to increace camera ciplling), but the clipping also clipped the hands off, if you hold your hands close to the head.
Is there another way to get it to work?
We also noticed another strange behavior - sometimes in multiplayer sessions, some avatars are displayed way too high (1-2 m I guess). The person whos avatar is displayed to high sees everything from the normal height, but other users sees the avatar higher. At first we thought it has something to do with the VR boundary(stationary/roomscale) and floor level, but the bug persisted after setting new boundarys.