Live swap of RPM avatars in unity

Hey guys! I’m trying to make a unity game where in a menu I can change the avatar of a player through different glb links while the game is running. Is there a way in c# that I can do this?

Hello, and welcome to the forum!
Yes, you can create an array or list of avatar URLs (strings) that you would like to load at runtime.
Then when you load the menu scene, you load the first avatar from the list. Each time the player changes the avatar, you load the new avatar using the index of the following element of the list to get the new URL of the avatar to load.
Also, you don’t need the previously loaded avatar when the new one is loaded, so you can call the Destroy method to discard the old avatar, but this depends on how many avatars you are using.
It might be better to disable the avatar instead of destroying it. You can use the SetActive method for this. This has the benefit that it will be faster than destroying the object, and also, you won’t need to load the avatar again if the player selects an avatar previously loaded, you can enable it again.

You also will need to subscribe to the OnLoadComplete event when loading the avatar, for example:
exampleLoader.OnLoadComplete += OnLoadComplete;

so you know when the loading is complete to disable the previously loaded avatar within the void OnLoadComplete() method.