Custom avatars
I was wondering if maybe someone has come across this issue and even maybe a solution (or an idea about this)?
We are using Normcore in our VR project and Avaturn avatars.
Everything is great when you set the custom avatars up with all the references to the bones and the normcore avatar bits (head and hands) and you instantiate them nicely set up from within the project.
However, the issue arises when we try to do it at runtime.
We are trying to move the avatars to be completely independent from having to be setup in the project - people can go on Avaturn website, create their avatars by taking some selfies, and then when they go into the app their avatars get pulled from Avaturn at runtime.
What Avaturn does it destroys the old avatar and instantiates a completely fresh one, so all the references for the armature are gone (not to mention the custom scripts are all gone, and it obviously doesn't exist inside the Normcore custom avatar).
I'm suspecting instantiating avatars from Avaturn like that at runtime is a deal-breaker here? Maybe someone has tried to use something similar to Avaturn with Normcore and knows how to go about this issue?
Any experience with this or ideas appreciated! Or suggestions for alternative avatar companies that do something similar and you know works with Normcore in such way also very much appreciated!
10 Replies
Hi @Ryllexya. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, it seems that Normcore uses metadata on the prefab to connect RealtimeComponents on all clients, and this cannot be done at runtime (source (https://normcore.io/documentation/realtime/common-questions#can-i-add-realtimecomponents-at-runtime)). This might be the reason why you're facing issues when trying to instantiate avatars from Avaturn at runtime.
However, Normcore does provide a way to create custom avatars. You can start by making an empty Game Object in the scene with a RealtimeAvatar component on it. RealtimeAvatar includes a button that will create all of the game objects and components needed for a basic avatar. You can then modify these components as per your requirements (source (https://normcore.io/documentation/guides/xr-avatars-and-voice-chat#creating-custom-avatars)).
For more advanced avatar customization, you can use the MetaAvatar component provided by Normcore. This component includes a button that will create all the components needed by the Meta Avatar SDK. You can then modify these components as per your requirements (source (https://normcore.io/documentation/guides/meta/meta-avatars-customization)).
If you're looking to use avatars from Avaturn or any other external source, you might need to manually set up the references to the bones and the Normcore avatar bits (head and hands) every time a new avatar is instantiated at runtime. This could potentially be done using a script that runs at runtime and sets up these references based on the structure of the avatar prefab.
However, please note that this is just a suggestion and might not work as expected due to the limitations of Normcore mentioned above. I would recommend reaching out to the Normcore support team for more specific guidance on this issue.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@164038313924231178> kapa.ai is still learning and improving, please let us know how it did by reacting below
what you probably want to do is have a blank realtime avatar all set up and then at runtime search for the Avaturn model and puppet it from the realtime avatar. if the bones are the same each time you can probably use transform.Find to get all the references
Sadly, I would have used this with Avatar SDK (which is the avatar company we used before).
We switched to Avaturn because they allow the whole realtime retrieval of avatars.
But I need my scripts (all the VR constraits) to exist inside their model that gets spawned, otherwise, it makes the entire app crash (and not just for me, but literally everyone gets thrown out of the app).
That's where the train has halted for me. 😦
Otherwise, I would have done it how you suggested!
what's the error log say?
Hmm I don't have the screenshot now, but I remember googling it, and it was related to getting references and the hierarchy of the model. The skeleton was fine, it was in the correct heirarchy, same as Avatar SDK avatars have always been. So then I moved components around, and that solved it.
I suggested setting up avatars and moving them to asset bundles, so they can still be instantiated at runtime outside the project, but sadly t hey are only interested in automated process where we dont have to do anything.
are you waiting for the model to download and instantiate before doing the search?
Oh, yes, I always make sure realtime is connected, and nothing is null before doing anything.
Also that crashing error existed in a properly set up avatar that exists in a Normcore resource folder. It is genuinely an issue with their avatar.
I meant the avaturn 3d character
assuming it has to fetch the data from a server
Update:
If anyone ever runs into similar issues, what worked for me was creating fake bones that were tracked properly, and when the new skeleton was instantiated - getting all the bones and then setting their position and rotation to the fake bones.