Skip to main content

Character Creation Attaching Clothing and Accessories

Key Problem

UploadLooking Infor Progressany possible way in attaching clothing and accessories to character

Expected Output

Find the best practice on how to attach clothing and accessories to character

Possible Solutions

  • Using prefabs for Clothing and Accessories.

    Pros :

    • Easier to apply since each Clothing and Accessories’ needed components are already set up before attaching,

    Cons :

    • Not flexible, adding new items need to build new app or new app bundle using Unity Editor
  • Changing/swapping mesh, materials, and textures at runtime

    Pros :

    • Flexible, can update content without the need to rebuild app
    • When modifying model using bone scaling, the scaling will automatically applied to the attached clothing

    Cons :

    • Need extra effort to assemble the item’s needed components.
    • If the item needs bone to function, said bones needs to be prepared beforehand in the skeleton
    • Need third party plugins to load mesh at runtime.

    Conclusion

    At this time, it’s decided to use prefabs for Clothing and Accessories.

    Clothing and Accessories which are using animations need to have the same rigs as the character. They can use the same animator of the character by ‘stitching’ them into the character they are attached to.

    See [Attaching Animated Clothing](Attaching Animated Clothing ff9a3ffaf63e45068be767e3dd7c2bb5.md) for details.

    Accessories which are not animated or using physics animation doesn’t need to have the same rigs and can be attached by parenting them into specific mounting point on the character.

    Notes :

    Possible solutions for loading mesh at runtime :

    • GLTFUtility, also used/included in ready player me SDK, free, uses glb/gltf format (blender 2.8 support glb/gltf 2.0 export/import)

    GitHub - Siccity/GLTFUtility: Simple GLTF importer for Unity