I am trying to replace the default XR avatar to the Ready Player Me one in real time.
The Ready Player Me SDK returns to me a URL where I can download the GLB, but I don’t know how replace it by the XR default avatar, or even instantiate it on the scene as Game Object.
I know that I can download the GLB using JavaScript fetch in a custom component, but I have no idea what to do next.
So we havent tested this yet but theoretically you should be able to leave the default avatar empty, grab a webxr component reference from one of your scripts and create an AssetReference from the ReadyPlayerMe avatar url using the static method AssetReference.GetOrCreate and assign it to the WebXR component. Not sure if it works out of the box right now tho but would be great to get it working
In general the easiest way to instantiate from a glb/gltf url is to create an AssetReference (using the static method mentioned above) and then call e g. instantiate (or just preload the bytes). That will internally handle caching and of potential extensions in the glb for you
Hm, the model itself looks alright when downloaded separately. Looks like one bone is moved to a wrong place after instantiation maybe - if you don’t assign it as default Avatar in your code, does the model look alright?
with the Needle sample Third-Person Control, you can easily learn what components you should attach to the avatar and the animation settings in Animator component :blobaww:
The avatar was made through Ready Player Me, and the animations were prepared through Mixamo. The avatar I use in the scene is the GLB downloaded from Ready Player me.