Imvu.Login().Then( userModel => userModel == null ? AssetLoader.Load(defaultAvatarUrl) : AssetLoader.Load(userModel) ).Then( gameObj => gameObj.SetActive(true) ).Catch( error => Debug.Log(error) );
Either way, it calls AssetLoader.Load(), which loads an IMVU asset. In this case, an avatar. This returns aPromise<GameObject, string>. The avatar will already be setup to work with Mecanim, and have an Animator on it. But, it will be inactive, so the asset won't actually appear in the scene until you tell it to. Hence the call toSetActive(true).
If there are any actual errors at either step, it will fall through to the Catch() and log the error.