Vurtworld
Vurtworld4mo ago

XR Origin

Hi, I'm trying to add a basic XR Rig as a Realtime+VR player with Normcore and it's kind of working. However I don't think I have done it right. I can see the players spawning in the editor and each player seems to be working on the Quest but I don't see the other players in the headset. Anybody have tips to look out for when building a rig like this?
No description
No description
20 Replies
kapa.ai
kapa.ai4mo ago
Hi @Vurtworld. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Sure, I can provide some guidance on setting up a basic XR Rig as a Realtime+VR player with Normcore. Here are some steps you can follow: 1. Create a blank Unity project: Start by creating a new Unity project. 2. Configure your project for XR: You need to configure your project for XR under XR Plug-in Management. 3. Set up the camera and player prefab: Move the camera back to the origin and drag a “Realtime + VR Player" prefab into the scene. 4. Add your App Key: Add your App Key to the Realtime component and hit Play. The default VR Player avatar prefab will spawn. 5. Check the avatar: If your app quits immediately on launch, it's most likely due to the entitlement check failing! Check your logs and make sure the Meta account used by your Quest has been added to the release channel for your Oculus App ID. 6. Test the build: You can send this build to anyone you’d like and Normcore will automatically connect you to the same room and instantiate an avatar for each person. Remember, all avatar customization settings are automatically imported from the user's system preferences. Head tracking, hand tracking, finger tracking, lip sync, and voice chat using Normcore's RealtimeAvatarVoice all work automatically. If you're not seeing other players in the headset, it could be due to a few reasons: - Network issues: Make sure all devices are connected to the internet and are able to communicate with each other. - App Key issues: Ensure that the same App Key is being used across all devices. - Avatar instantiation issues: Check if the avatars are being instantiated correctly and at the right location. For more detailed instructions, you can refer to the XR Avatars and Voice Chat guide (https://normcore.io/documentation/guides/xr-avatars-and-voice-chat) and the Meta Avatars Setup guide (https://normcore.io/documentation/guides/meta/meta-avatars-setup#set-up-meta-avatars) from the Normcore documentation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@945773412788351057> kapa.ai is still learning and improving, please let us know how it did by reacting below
Vurtworld
Vurtworld4mo ago
As a followup to this question, how do I request ownership to an object with Realtime view and transform in the scene, that I want to grab? I can grab it now but it snaps back to it's original position after I let go of it.
Mechabit
Mechabit4mo ago
you should keep your xr rig separate from your avatar prefab for your 2nd question if you @ the bot it can answer it easily @Normcore Assistant how do i request ownership of a realtime transform
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- To request ownership of a RealtimeTransform in Normcore, you can use the RequestOwnership() method. Here's an example of how you can do this:
public void CreateObjectAndRequestOwnershipOfRealtimeTransform() {
// Instantiate the My Object prefab, leave the view unowned.
GameObject myObject = Realtime.Instantiate("My Object", ownedByClient: false);

// Get the RealtimeTransform component
RealtimeTransform realtimeTransform = myObject.GetComponent<RealtimeTransform>();

// Request Ownership
realtimeTransform.RequestOwnership();
}
public void CreateObjectAndRequestOwnershipOfRealtimeTransform() {
// Instantiate the My Object prefab, leave the view unowned.
GameObject myObject = Realtime.Instantiate("My Object", ownedByClient: false);

// Get the RealtimeTransform component
RealtimeTransform realtimeTransform = myObject.GetComponent<RealtimeTransform>();

// Request Ownership
realtimeTransform.RequestOwnership();
}
In this example, a GameObject is instantiated and the RealtimeTransform component is fetched. Then, ownership is requested for the RealtimeTransform component. Remember, in order to move an object with a RealtimeTransform component, your client needs to be the owner of the RealtimeTransform component. You can also request ownership of a RealtimeTransform component by using the Request Ownership button in the editor inspector. For more information, you can refer to the RealtimeTransform documentation (https://normcore.io/documentation/realtime/realtimetransform#how-it-works) and the Ownership documentation (https://normcore.io/documentation/room/ownership-and-lifetime-flags#requesting-ownership-of-any-realtimecomponent-or-realtimemodel) from the Normcore documentation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@162940911964258305> kapa.ai is still learning and improving, please let us know how it did by reacting below
Vurtworld
Vurtworld4mo ago
Hi, thanks for getting back to me on this. Could you elaborate a tiny bit further? I'm not sure I understand. How exactly do I setup the XR rig to be the Avatar or how do I combine them? Any help would really be appreciated. Thanks I've unpacked the XR Origin Prefab and used it's Camera, Left Hand and Right hand as the components for the Avatar, but in the 2 (Quest) headsets don't see each other
Mechabit
Mechabit4mo ago
in the demo scene the avatar prefab is just the visual components then you asign the xr rig to the avatar manager inspector that way the xr rig will drive the avatar when other people join you will spawn duplicate avatars if the xr rig was on there it'd spawn duplicate rigs as well which is why you can't see anyone, you're controlling all the rigs best keep them off the avatar then
Vurtworld
Vurtworld4mo ago
I'll try again
Mechabit
Mechabit4mo ago
XR Avatars and Voice Chat | Normcore Documenation
This guide walks you through adding avatars and voice chat to your XR application.
Vurtworld
Vurtworld4mo ago
But the XR rig needs the realtime component right?
Mechabit
Mechabit4mo ago
you can see the avatar only has realtime transform on it and realtime voice and realtime avatar and nothing else no, the xr rig is completely separate the avatar manager is the only place that needs references to the rig
Mechabit
Mechabit4mo ago
No description
Vurtworld
Vurtworld4mo ago
Do I keep the XRrig in the Scene? How else do I reference the components?
Mechabit
Mechabit4mo ago
all the mamager is doing is copying the position and rotation of the rig to the local avatar if you spawn your rig at runtime just add the refs in awake
Vurtworld
Vurtworld4mo ago
I just autospawning at the start of the app I haven't changed any code yet
Mechabit
Mechabit4mo ago
just grab the refs for the avatar manager before connecting
Vurtworld
Vurtworld4mo ago
I will give it a go tomorrow. It's 2:25 am over here
Lost Wizard Corp.
does the prefab pick up the geometry from the xr rig ,
Mechabit
Mechabit4mo ago
no, just position and rotation you add the geometry to the avatar prefab