Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

UMA - Unity Multipurpose Avatar on the Asset Store!

Discussion in 'Assets and Asset Store' started by FernandoRibeiro, Dec 24, 2013.

  1. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    I'm trying to create a multiplayer first person game, how would I approach the subject of first person arms with UMA? Would I create a race that only has arms? Or is there a better way? (Each player will have a full body + extra arms on the camera)
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345

    1. You can hide the head and position a camera on the UMA. You can manage all this using UMARendererAssets (see the sample) to hide the head, yet make it visible in reflections and shadows.
    2.You can simply position the camera in front of the face.

    OR

    1. You can make a set of recipes that are arms+hands only. And make a whole bunch of Mesh Hide Assets to hide the torso parts of the armor that you don't need.
     
    boysenberry and hopeful like this.
  3. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    Thanks @Jaimi this is really helpful, I'm a little unclear on the layer index renderer asset, is there anything specific I should know? Also is there a way to make DCA Renderer Manager only apply to a specific camera?
     
  4. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    I've just noticed the mirror is done with another camera, just trying to work out what is making the the head show for one camera but not for the other
     
  5. Bucee

    Bucee

    Joined:
    Apr 20, 2016
    Posts:
    13
    Thanks again for the help on the Cloth physics, that was very helpful. I managed to get a functional version of UMA running on Android on a "barebones" level, but in my game for some reason it can only launch on Android when there is nothing in the UMA Global Library. When I put even one shirt in the Global Library, the game crashes on Android with no error messages given. Is there perhaps a way I can use UMA clothing wardrobes without the use of the Global Library so I can see if that's the real cause of the crashes?
     
  6. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    355
    separate head renderers on different layers corresponding to each camera.
     
  7. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    So the mirror camera has no culling mask so can see "Everything" whereas the main camera can only see the selected layers? So which layer is the shadow being placed on that allows the main camera to see it?
     
  8. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    355
    The layers may be messed up since those are project settings.
    If you look at the RendererAssets, it's putting the "HeadRenderer" on layer 11 and "SecondHead" on 31. (you can set those to whatever your project needs).
    The the main camera is culling layer 11 (the head rendered in the mirror) but it includes the layer of "SecondHead" which is set to "Cast Shadows Only".
     
  9. Wothanar

    Wothanar

    Joined:
    Sep 2, 2016
    Posts:
    111
    im using addressables now and its seems some assets gived a long path and that broke the system coz they look like empty or bugged so i deleted those and it build wel the addressables however. now have this error


    UMAResourceNotFoundException: UMAGlobalContext: Unable to find SlotDataAsset: o3n_female_eyelash_LOD1
    UMA.UMAGlobalContext.InstantiateSlot (System.String name) (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGlobalContext.cs:119)
    UMA.UMAPackedRecipeBase.UnpackRecipeVersion3 (UMA.UMAData+UMARecipe umaRecipe, UMA.UMAPackedRecipeBase+UMAPackRecipe umaPackRecipe, UMA.UMAContextBase context) (at Assets/UMA/Core/Scripts/UMAPackedRecipeBase.cs:947)
    UMA.UMAPackedRecipeBase.UnpackRecipe (UMA.UMAData+UMARecipe umaRecipe, UMA.UMAPackedRecipeBase+UMAPackRecipe umaPackRecipe, UMA.UMAContextBase context) (at Assets/UMA/Core/Scripts/UMAPackedRecipeBase.cs:35)
    UMA.UMAPackedRecipeBase.Load (UMA.UMAData+UMARecipe umaRecipe, UMA.UMAContextBase context) (at Assets/UMA/Core/Scripts/UMAPackedRecipeBase.cs:20)
    UMA.UMATextRecipe.Load (UMA.UMAData+UMARecipe umaRecipe, UMA.UMAContextBase context) (at Assets/UMA/Core/Extensions/DynamicCharacterSystem/Scripts/pUMATextRecipe.cs:189)
    UMA.CharacterSystem.DynamicCharacterAvatar.LoadCharacter (UMA.UMARecipeBase umaRecipe, System.Collections.Generic.List`1[T] Replaces, System.Collections.Generic.List`1[T] umaAdditionalSerializedRecipes, UMA.UMARecipeBase[] AdditionalRecipes, System.Collections.Generic.Dictionary`2[TKey,TValue] MeshHideDictionary, System.Collections.Generic.List`1[T] hiddenSlots, System.Collections.Generic.List`1[T] HideTags, UMA.UMADnaBase[] CurrentDNA, System.Boolean restoreDNA, System.Boolean skipBundleCheck) (at Assets/UMA/Core/Extensions/DynamicCharacterSystem/Scripts/DynamicCharacterAvatar.cs:2931)
    UMA.CharacterSystem.DynamicCharacterAvatar.BuildCharacter (System.Boolean RestoreDNA, System.Boolean skipBundleCheck) (at Assets/UMA/Core/Extensions/DynamicCharacterSystem/Scripts/DynamicCharacterAvatar.cs:2764)
    UMA.CharacterSystem.DynamicCharacterAvatar.BuildFromComponentSettings () (at Assets/UMA/Core/Extensions/DynamicCharacterSystem/Scripts/DynamicCharacterAvatar.cs:559)
    UMA.CharacterSystem.DynamicCharacterAvatar.Start () (at Assets/UMA/Core/Extensions/DynamicCharacterSystem/Scripts/DynamicCharacterAvatar.cs:421)

    and it point to the o3n_female_eyelash_LOD1 ... what should i do? i will check if i can add it to the addressables and hopefully would not give me error but this start to be a pain to me i dont like when things like this come from no where and well this is why i always like to use my own codes and system becouse this bugs where im very lost and seems to not be good to deal with.

    Any help? or probably i would have to switch to my own avatar system

    PD : https://gyazo.com/c8131925edfd53281e4112e59585a6c3
    as you can see here , the slot its there as addressables... should not be working? why it give me the error? what im losing? should not uma handle the addressables itself? any help? thanks
     
    Last edited: May 18, 2020
  10. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    UMA does manage the addressables for you, if you let it.

    Looking at the code, it looks like BuildCharacter called LoadCharacter, and that skipped the bundle checking and coroutine, and went straight to loading the recipe.

    It can only do this in two cases:

    If the UMAGlobalContext does not exist (which we can see it does in the line below),
    or if you unselected "bundle check" and turned off UMA from checking for bundles.

    Bundle Check is required if you want UMA to manage the loading and unloading of bundles.

    If that's *not* what's happening, let me know. I'll dig through here a little bit.

    If you're constructing UMA's from scratch, that *should* be turned on by default.

     
    Last edited: May 18, 2020
  11. Wothanar

    Wothanar

    Joined:
    Sep 2, 2016
    Posts:
    111

    Thanks for your answear , i will check that stuff, im just wondering about the memory stuff how should work , im trying to use o3n race with mobile materials well set but in android and im getting crash's hope this stuff you say it fix , anyways its there any guide or official documentations or video tutorials of this addressables but Uma background workaround flow? thanks and sorry for being upset but since im working for my customer and cant archieve this lol im get sad :)
     
  12. Wothanar

    Wothanar

    Joined:
    Sep 2, 2016
    Posts:
    111
    I just gonna leave uma if dont find the solution for work with android but well i will give another try with your check solution , anyways would be nice more documentation and specially videos of this topic of uma and addressables , i try to find some but fail using google and youtube... if anyone can point me some would be nice. and i really like uma would be good if can handle to run very low memory and only loading to memory what i see on screen becouse this is what im learning so far coz working on very big proyects atm. thanks for understanding.
     
  13. Wothanar

    Wothanar

    Joined:
    Sep 2, 2016
    Posts:
    111
    Can you now explain me where i should find that "bundle check" stuff? i dont find it sorry my ignorance

    Here is the https://gyazo.com/2c74a3f23e9a019abefc77ce01af4ed4 UMA_GLIB gameobject
     
  14. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    Note: I replied on the discord, but in case you don't see it, it's on the DynamicCharacterAvatar.

    Also - 512 is way too small for the atlas, unless you have already scaled all of your textures down. Take a look at your texture sizes, then divide them by the initial scale factor. Your atlas should be created large enough to store your textures.
     
    hopeful likes this.
  15. pedropla

    pedropla

    Joined:
    Apr 9, 2018
    Posts:
    13
    Any documentation on how to create an addressable recipe bundle for UMA (with everything in that recipe) that can be stored remotely and not be in the General Library when the game is built but added later on and dynamically downloaded and loaded into the game?

    @Jaimi, since you mention that UMA can manage the addressables for you, does that mean it can handle that entire portion without having to use the standard Unity Addressables download and then manually adding it to the General Library before using the recipe?

    I've been looking for documentation or better yet, a code example of how to do this but haven't found any.

    Thanks in advance.
     
  16. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    I found it's not only the color applying lag but also the fact that I'll have to use the skin shader for the eyebrows if I want them to be overlays for the Face slot. So I got a workaround to this matter: I peeled the eyebrow part of the face mesh and made them into a separate slot with its own material. Now I can deal the color with my old methods. But there still is a catch: I found the generated texture lost great amount of alpha channel's data:
    The eyebrow on standard fade shader with original texture:
    upload_2020-5-19_15-46-16.png

    With UMA generated textures:
    upload_2020-5-19_15-46-36.png

    Any settings I can tweek to preserve the original texture's alpha data?
     
  17. pedropla

    pedropla

    Joined:
    Apr 9, 2018
    Posts:
    13
    Just to add some code context. This is how I'm currently loading a recipe:

    Code (CSharp):
    1.                 UMA.UMATextRecipe recipe = Avatar.context.GetRecipe(recipeName, true);
    2.                 if (recipe)
    3.                 {
    4.                     Avatar.SetSlot(recipe);
    5.                 }
    But even with the recipe added as an addressable, UMA can't find it unless it's in the General Library. Would the correct way to go about dynamic loading of a new recipe from a remote server be to add the addressable reference to the General Library at runtime and then try to load it the same way I've been loading it?

    If so, what is the correct way to add the addressable reference to the General Library at runtime?

    The code documentation I see here: http://umaapi.secretanorak.com/ is for UMA 2.7.0 and addressable support was only added in 2.10.0.
     
  18. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    There is no current documentation besides what is in the "Read me now" file.

    When UMA uses addressables, it must be in the catalog. So you would need to manage the update of the addressables catalog (by downloading an update).

    In UMA, each recipe has a label generated for it. When UMA manages the addressables, the following happens:

    When you call BuildCharacter, UMA generates a list of labels for the recipes that are used by the character.
    It calls the global library function "LoadLabelList()", which stores the addressable handle, and saves all of the build information.
    The Addressables system then loads the items that are tagged with the labels passed. These can be cached locally, or stored on an external server.
    When the items have been loaded and stored in the global library, then the addressables system fires the event, and UMA picks it up, finds the build information, and completes building the character. At this point, a coroutine is setup with a short delay (you can specify how long you want the delay to be), and when it fires off, it frees the references for the previous recipes that were used. If none of the items are referenced by anything else, they are freed from memory.

    In this way: All slots, overlays, and textures that are currently being used are kept in memory.

    You have the option to mark specific recipes as "Resource only". At that point, the items in those are store directly in your games resources and shipped with your project. These are also loaded into memory at all times. You may want to do this for things that are always in use (like the base race recipes).

    If you want to manage your own labels, you must insure that UMA knows about the items. You can download items and load them directly into the library, using the library function ProcessItem().
    You can also manage the loading of items manually. When you do this, you would just call the library function LoadLabelList(), which would load the items out of the catalog into memory. You would be responsible for releasing them yourself at that point.

    Hope this helps.
     
    attaway and hopeful like this.
  19. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    You can try changing the TextureType to Texture instead of Diffuse. Otherwise, there is a bugfix coming that addresses this problem.
     
  20. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345

    UMA can only find items that are in the library. The best (easiest) way to handle this is to update your catalog with the new items. You would need to label the items that you want preloaded (basically anything except slots/overlays/textures) with a label (example "UMA_UPDATEDRECIPES"), and then force those to preload by calling LoadLabelList(). If you let UMA generate the labels for your updated recipes, everything else should then just work.
     
  21. pedropla

    pedropla

    Joined:
    Apr 9, 2018
    Posts:
    13
    Thank you very much for you replies they definitely give me a lot more information to help better understand UMA addressables. One question though, when you refer to the catalog, are you referring to the Unity Addressables Catalog, or the UMA specific General Library "catalog" of UMA recipes?

    If you're referring to the Unity addressables catalog, does that mean I should load the recipe using the addressable "name", "path", or the recipe name?
     
  22. leapp

    leapp

    Joined:
    Mar 19, 2015
    Posts:
    11
    I just want to optimize the UMA code for reuse Rendertexture. is it easy to do that?
     
  23. leapp

    leapp

    Joined:
    Mar 19, 2015
    Posts:
    11
    I just want to optimize the UMA code for reuse Rendertexture. is it easy to do that?
     
  24. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    I'm assuming if I want a separate mesh for arms to attach to the camera I will have to just create an arms only race? As the main UMA is what everyone else see's (and the current player can see it without head and arms so they can look down) but I need a set of arms to attach to the players camera for a better first person feel, do you think an arms only race is the way to go, or should I just have a RendererAsset to give me the arms and a script to reparent the arms mesh to the camera? (not sure about this because I think I will need another skeleton or the arms will just bug out trying to reposition back to the main skeleton arms position instead of relative to the camera)
     
  25. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    Think it might be less work if i just have an arms only race, I can have that attached to the camera and just make sure when I equip something to the torso I apply the same to the arms.

    In my game torso is one slot (which covers torso and arms), but I have it split into torso and arms so that I can hide the fullbody arms for the first person camera.
     
    Last edited: May 20, 2020
  26. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,181
    I'm not sure why you'd need an arms-only race. Wouldn't it work just to have an arms-only recipe?

    Though, I suppose, if you were doing random generation of arms, it would make sense to have an arms-only race.
     
  27. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    I'm referring to the Addressables catalog. You would need to update it with the new information. Then, you would need to tell the AssetIndexer to load the labels for the recipes you want to use.
     
  28. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    By default, UMA creates RenderTextures for the atlas. It can, optionally, copy those to system memory textures. This however, causes a GPU stall and is really slow.
    If you use UMASimpleLOD, you can tune it to regenerate RenderTextures smaller when things get farther away. In this case, you can also (in some cases) disable MipMaps on the generator, as you will be manually managing this.

    Beyond that, I'm not sure what you are wanting. More information would be helpful.

    If you want to work on UMA to improve this, it is open source. There is a trello task out there to use AsyncGPUReadbackRequest to manage the movement of Rendertextures to System Textures better.
     
  29. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    I don't really need another race, I just need a reliable way that I can have a separate UMA that just has arms that is attached to the camera, possibly a recipe is the way to go.
     
    hopeful likes this.
  30. GeekyRaptorStudios

    GeekyRaptorStudios

    Joined:
    Jun 22, 2019
    Posts:
    3
    Any chance there is an in depth tutorial for making compatible custom UMA cgaracter, including non human ones, using blender 2.79, since that is what I use. I would like to make UMA characters of animals and fantastic creatures. Like dragons and Deer and Unicorns and Cats. But there isn't any real tutorials on YouTube and I can't find a manual anywhere on this part of using the UMA System. Any advice or help would be appreciated.
     
  31. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    https://www.youtube.com/channel/UCjIhCVu3eN5qLAX7H9Uo6jg

    He has a series for both creating custom characters/content as well as importing non-human characters which should help.
     
    hopeful likes this.
  32. pedropla

    pedropla

    Joined:
    Apr 9, 2018
    Posts:
    13
    Got it. Makes a lot more sense to me now! Thanks!
     
  33. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    824
    I am using Texture type, not Diffuse Texture. I've got a workaround to this issue, I created my own method to be called in the CharacterUpdate event of dynamic avatar to assign the selected texture to the material.
     
  34. Sascha2

    Sascha2

    Joined:
    Nov 1, 2017
    Posts:
    10
    Hello, I wanted to make some of my UMAs transparent and dissolvable. So I created a new UMAMaterial and shader. It all works as intended, however, I had to change the material on all slots and overlays for it to work. I actually hoped to share these slots and overlays with my non-transparent UMAs and just add a body-wardroberecipe to my transparent ones. Do I really have to duplicate it all?

    Edit, encountered a problem: I am using this approach for the transparency in URP: https://forum.unity.com/threads/question-about-transparency-and-rear-faces.774224/#post-5213051

    This causes issues with any alpha-cutout textures such as eyebrows and eyelashes. I guess I would need them to not be baked into the character mesh so I can remove them from the "ZTestTransparent" layer. Is this possible or do you know of another approach to handle transparency in URP?
     

    Attached Files:

    Last edited: May 21, 2020
  35. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Hey there, i can't get rid of the Head...
    I tested it with a recipe, then the head disappear but the inmouth and the eyes still exist.
    For a while ago there was the head as extra object, right?


    Because i use UFPS 2 with UMA integration and they want to remove a gameobject, also in the secret anorak uma tutorial series are a seperat head.
     
  36. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    If the materials are basically compatible, then you can hook into the CharacterUpdated event, and swap out the shader on the material, or swap the material with your own version and copy the textures/properties to it. This will stop you from having to duplicate everything, and taking the speed hit for cutout.

    As for the other item - you can create a separate UMAMaterial for different parts, and then it should create a different atlas. Or you can tell the new UMAMaterial to not create an atlas at all.
     
    Sascha2 and hopeful like this.
  37. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    You can do what you are currently doing, but also tell it to remove the eyes and inner mouth (it should let you select multiples).
    Or, you can be extra fancy, and use the UMARendererAssets, and turn the head off for third person view only (and still keep shadows and mirrors working). There is an example of this in the UMARendererAsset sample scene.
     
    Neo-Gamefactory likes this.
  38. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    WillB also has a bunch of separated eyebrows for the faces in his face pack. They float slightly above the head, and use a different material, and are much higher quality, if you want to look into those.
     
    hopeful likes this.
  39. scottpkane94

    scottpkane94

    Joined:
    Aug 24, 2019
    Posts:
    27
    I'm trying to add a tag to the head position of my avatar so that I can align the cameras position on x/z. How can I do this with an avatar created DCA?
     
  40. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    You can get the position of the Head bone by looking in the skeleton hierarchy at runtime, and attach it to that. If you want to do this at design time, you can use the bone builder. Not, you should turn off Rebuild Skeleton if you do this, or
    you will have to rebuild it if you rebuild your skeleton.
     
  41. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    This works great, thank you :)
     
    Jaimi likes this.
  42. ledentsov

    ledentsov

    Joined:
    Feb 8, 2017
    Posts:
    108
    Hello! There are any samples of the facial animation for UMA character?
     
  43. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    Yes - The HumanMaleDCS prefab is setup to animate the UMA's face.
     
  44. wagnificent

    wagnificent

    Joined:
    Jun 17, 2017
    Posts:
    6
    Hello, and thank you for this amazing tool! UMA is amazing, and Secret Anorak's tutorials on YouTube have been very helpful in getting me started with it. I made a new project and followed along with the 101 tutorials, and everything worked perfectly.

    However, when I import UMA into an existing project, I get a whole bunch of warnings and errors (see attachment). I looked into the errors, which insist that PlayerPrefs doesn't have definitions for things that it definitely does have definitions for.

    Both projects use the same version of Unity (2019.3.12f1), so I'm having trouble figuring out why it would work in a new project but not in an existing one. Any help or advice would be greatly appreciated!

    UMA Import Errors.png
     
  45. wagnificent

    wagnificent

    Joined:
    Jun 17, 2017
    Posts:
    6
    In case it helps, here are the errors that I am getting in the scripts too:

    UMAEditorUtilities Errors.png

    UMAWebGLSetup Errors.png
     
  46. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    The most likely reason is that you have your own class named "PlayerSettings" in the global namespace, and that is conflicting with the Unity version.
    If that is the case, the only real answer is to put your PlayerSettings class in your own game-specific namespace.
     
  47. wagnificent

    wagnificent

    Joined:
    Jun 17, 2017
    Posts:
    6
    Wow I can't believe I missed that. That was it. Thanks!
     
  48. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    You're welcome. And we've all done similar, no worries.
     
  49. RPowers

    RPowers

    Joined:
    May 14, 2015
    Posts:
    114
    I've recently upgraded to URP and am noticing an issue with my avatar's DNA. Some DNA settings when set to a high or low value, like Belly, looks really weird. It's like less vertices are being morphed causing hard edges. This did not happen before in Build-In RP. The race I'm using comes from Will B's Human Male 2.0 pack (all his stuff is fantastic regardless of this issue). I've attached images comparing Built-In and URP. Does anyone have any idea why this is happening?
     

    Attached Files:

  50. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,345
    That looks more like your Quality Settings have less than 4 bone weights. You might want to validate that it is set to 4 for all of your Quality levels.

    blendweights.png
     
    RPowers and hopeful like this.
unityunity