Brotchvorger
Brotchvorger6h ago

Using the OVRCamerRig as a Custom Avatar spawns in strange locations

Hey ya'll - I've made the OVRCameraRig my custom avatar and followed the documentation to get that setup. It spawns but the position always seems to be different. It usually spawns in the floor. I tried making an empty GameObject to use as the local player root transform, but then it spawns in the sky for some reason. Any guidance would be appreciated. Thanks!
5 Replies
kapa.ai
kapa.ai6h ago
Hi @Brotchvorger. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It sounds like you're experiencing issues with the spawn position of your custom avatar when using OVRCameraRig as the avatar root. This is a common challenge when integrating custom camera rigs or XR setups with Normcore's avatar system. Here are some key points and recommendations based on the Normcore documentation: 1. Avatar Root and Head Assignment:
When using a custom camera rig (like OVRCameraRig), it's important to ensure that the RealtimeAvatarManager is correctly wired up to use the transforms from your rig. Specifically, you should assign the correct root, head, and hand transforms from your OVRCameraRig to the RealtimeAvatarManager. This ensures that the avatar's position and orientation match your camera rig, rather than defaulting to unexpected locations. If these references are not set up properly, the avatar may spawn at the origin or in an incorrect position, such as inside the floor or in the sky.
XR Avatars and Voice Chat 2. Prefab Setup:
Make sure your custom avatar prefab (which includes the OVRCameraRig or its relevant parts) is set up as described in the documentation:
- The prefab should have a RealtimeAvatar component at its root. - The prefab should be placed in a Resources folder so it can be instantiated at runtime. - Assign this prefab to the RealtimeAvatarManager's "Local Avatar Prefab" field. 3. Transform Hierarchy and Positioning:
If you use an empty GameObject as the root, ensure that its position is set to (0,0,0) in the scene and that the OVRCameraRig is a child of this root. Unexpected offsets can occur if the root or child objects have non-zero positions or rotations.
Creating custom avatars 4. RealtimeTransform and Rigidbody:
If your avatar prefab includes a RealtimeTransform, be aware that transform synchronization can be affected by the presence of Rigidbody components and the transform hierarchy. For XR avatars, you typically want to synchronize the head and hands, not the entire camera rig, to avoid conflicts.
RealtimeTransform 5. Testing and Debugging:
- Double-check the initial positions of all relevant GameObjects in your prefab. - In Play mode, inspect the instantiated avatar's transform hierarchy to see where the offset is introduced. - Make sure there are no conflicting scripts or components that might be resetting or modifying the position at runtime. If after these checks the issue persists, please provide more details about your prefab hierarchy and how you've assigned the transforms in RealtimeAvatarManager. This will help narrow down the cause of the unexpected spawn positions. Summary:
The most likely cause is incorrect assignment of root/head/hand transforms or unexpected offsets in your prefab hierarchy. Carefully review your prefab setup and the transform assignments in RealtimeAvatarManager to ensure everything is wired up as expected. If you need more detailed step-by-step guidance, the XR Avatars and Voice Chat guide is a great resource. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6h ago
<@473336925474783233> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Brotchvorger
BrotchvorgerOP6h ago
@Normcore Assistant Which components from the OVRCameraRig should be set as Head, Left Hand, and Right Hand?
kapa.ai
kapa.ai6h ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- The knowledge sources do not explicitly specify which components from the OVRCameraRig should be set as Head, Left Hand, and Right Hand in the RealtimeAvatarManager. However, they do state that when using a custom camera rig, you need to wire up the Root, Head, and Hand transform inputs on the RealtimeAvatarManager to ensure your RealtimeAvatar instance matches the transforms of your camera rig instead of using the default Unity XR APIs. This is especially important when using plugins like VRIK or custom rigs like OVRCameraRig. If you are unsure which transforms to use, you should look for the corresponding head and hand anchor transforms within your OVRCameraRig and assign those to the RealtimeAvatarManager’s fields. If the documentation for OVRCameraRig or your project’s hierarchy does not make this clear, you may need to inspect the OVRCameraRig in your Unity scene to identify the correct transforms. I'm sorry, but there is no explicit mapping provided in the Normcore documentation for OVRCameraRig’s components to the Head, Left Hand, and Right Hand fields in RealtimeAvatarManager Common Questions: XR. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6h ago
<@473336925474783233> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?