LogoLogo
WebsiteBlogForumsSign up
  • Welcome
  • How Ready Player Me works
  • FAQ
  • 👩‍💻Integration Guides
    • Overview
    • Unity
      • Quickstart
      • Avatar Creator Integration
        • WebView Avatar Creator
          • Avatar Creator for Android & iOS
          • Avatar Creator for WebGL
        • Build your own Avatar Creator
          • Start with the sample
          • Elements
            • Asset Selection Element
            • Color Selection Element
            • Template Selection Element
            • Body Shapes Selection Element
            • Gender Selection Element
            • Avatar List Element
            • Photo Capture Element
            • Signup Element
            • Login Element
            • Logout Element
          • User Management
      • Load 2D Renders
      • Avatar Loader Window
      • Setup Multiplayer
      • Setup for XR (Beta)
        • Setup the Player Avatar
        • Setup Meta Movement SDK
        • Setup Final IK
        • Setup XR Hands
          • RpmHandDriver script
        • Facial Animations
        • VR Avatar Creator
      • Animations
        • Ready Player Me Animation Library
        • Mixamo Animations
      • Optimize
        • Avatar Configuration
        • Avatar Caching
        • Defer Agents
      • Code Samples
        • Loading 3D Avatars
        • Loading 2D Avatars
        • Avatar Creator (WebGL)
        • Avatar Creator (Desktop)
        • Avatar Creator (Mobile)
        • Distance-based LODs
      • Troubleshooting
        • Editor UI Window Issues
        • Avatar loading issues
        • iOS issues
        • WebGL issues
        • Firewall issues
        • Updating the SDK
          • Unity SDK 3.0.0 Migration guide
          • Unity SDK 4.0.0 Migration guide
          • Unity SDK 5.0.0
          • Unity SDK 7.0.0
          • WebView 2.0 Migration
        • Package installation issues
      • Help us improve the Unity SDK
      • FAQ for Unity
      • Early Access Features
    • Unreal Engine
      • Quickstart
        • Import SDK Manually
      • Avatar Creator Integration
        • Build your own Avatar Creator
          • Sample Structure
          • Customization Guide
        • WebView Avatar Creator
      • Load Avatars
      • Animations
        • Ready Player Me Animation Library
        • Loading Mixamo animations
        • Mannequin animation retargeting
        • Blender FBX export to UE
        • Oculus Lipsync integration
      • Optimize
        • Avatar configuration
        • Avatar caching
        • Avatar preloading
      • Code Samples
        • Unreal Engine 5 samples
        • Lyra project integration example
        • VR Avatars
        • Unreal Engine 4
      • Troubleshooting
        • Project compilation issues
        • Missing materials on built applications
        • Avatar loading issues
        • Animation issues
        • Unreal SDK breaking changes
        • Avatar lighting issues
        • Updating from earlier versions
          • Unreal SDK 3.0.0 Migration guide
        • Auto LOD issues
      • Help us improve the Unreal Engine SDK
      • FAQ for Unreal Engine
      • Early Access Features
    • React
      • Quickstart
    • React Native
    • iOS Native
    • Android Native
    • Web Integration
      • Quickstart
      • User Management
        • Guest Accounts
        • Account Linking
      • Avatar Creator integration
      • Optimize
    • API Integration
      • Quickstart
      • Custom Avatar Creator
      • User management
        • Ready Player Me Account
        • Anonymous Accounts
    • UX/UI Guidelines
      • Summary & quick tips
      • UX and UI guidelines and essentials
        • Foundation for good user experience
          • Layout
          • Colors
          • Typography
          • Icons
          • Dark mode and light mode
        • Mobile best practices
          • Layout
        • Making Ready Player Me feel native
          • Seamless Avatar Integration
          • Consistent Branding
          • Responsive Layout
          • Performance Optimization
        • Discoverability of the avatar editor
          • Onboarding tutorial
          • Clear navigation
          • Contextual Placement
  • 🖌️Customizing Guides
    • Studio (Developer Dashboard)
    • Avatar Creator Appearance
      • Avatar URLs
      • Avatar Shortcodes
    • Upload and Manage Custom Assets
      • Asset Manager in Studio
      • Configure in Studio
      • Manage custom assets using the API
      • Unlocking assets through API (Beta)
    • Create Custom Assets
      • Fullbody Outfits
        • Checking Skin Weights
      • Tops, Bottoms, Shoes
        • Editing templates
      • Hairstyle
      • Headwear
      • Facewear
      • Glasses
      • Hero Characters
      • Modeling Guidelines
  • 🔃API Reference
    • REST API
      • Authentication
      • Avatars
        • GET - 3D avatar
        • GET - 2D Render of an Avatar
        • GET - Metadata
        • PUT - Equip an asset
        • PUT - Unequip an asset
      • Assets
        • Asset Entity Properties
        • POST - Create Asset
        • GET - List Assets
        • PATCH - Update Asset
        • POST - Upload Asset Files
        • POST - Add Asset to Application
        • DELETE - Remove Asset from Application
        • PUT - Unlock asset for a user
        • PUT - Lock asset for a user
      • Users
        • POST - Create User
      • Auth
        • GET - Token
      • Changelog
    • Avatars
      • Full-body avatars
      • Full-body XR avatars
      • Half-body avatars
      • Morph targets
        • Apple ARKit
        • Oculus OVR LipSync
    • Avatar Creator
  • 🔉Support
    • Forums
    • Licensing & Privacy
Powered by GitBook
On this page
  • Enable Caching
  • Custom Avatar Configuration parameters
  • Stored avatar data location
  • Cached avatar data use and updating
  • Disable Caching
  • Manage avatar cache data
  • Unity Editor Avatar Loader never caches
  • Examples

Was this helpful?

  1. Integration Guides
  2. Unity
  3. Optimize

Avatar Caching

Store avatar assets and date locally.

PreviousAvatar ConfigurationNextDefer Agents

Last updated 19 days ago

Was this helpful?

The SDK provides an experimental avatar caching functionality. If avatar caching is enabled, every time an avatar is loaded, its assets are stored locally. If you subsequently try to load the avatar again, the system checks if the avatar needs to be updated, and if so, downloads and saves the updated avatar locally. If the avatar does not need to be updated, the avatar is loaded from the locally stored file.

Avatar caching is available at runtime and includes support for .

If a Ready Player Me user changes an existing avatar, for example, chooses a different hairstyle, then the avatar needs to be redownloaded even if it is cached locally. This ensures that the application loads the most up-to-date avatar.

Enable Caching

Avatar caching is disabled by default. To enable avatar caching, do the following.

  1. Open Ready Player Me > Settings.

  2. Check Avatar caching enabled.

Custom Avatar Configuration parameters

When Avatars are loaded via the Avatar API, you can include custom Avatar Configuration parameters to control the configuration of the downloaded avatar. Customizations include texture settings, mesh LODs, and included morph targets.

Stored avatar data location

Downloaded avatar data is stored based not only on the avatar GUID, but also the assigned Avatar Configuration parameters. This means that multiple instances of an avatar's data may exist in cache at any given time.

Avatar data is stored at

<Persistent Data Path>/Avatars/<avatar GUID>/<Avatar Config parameters hash>/

Cached avatar data use and updating

  • At runtime, when caching is enabled via the Ready Player Me Settings window, the Avatar Loader checks the state of the avatar on the Ready Player Me server before downloading. If the avatar has not been modified since it was last stored in the client-side cache, the avatar data for the given avatar GUID and Avatar Configuration parameters are loaded from the cache.

  • If changes were made to the avatar on the Ready Player Me server, the client-side cache for the given avatar GUID is cleared and recreated when subsequent AvatarObjectLoader.LoadAvatar()requests are made.

  • If the avatar download is interrupted or aborted during data transmission, any corrupt client-side cache data is deleted and recreated the next time the avatar is downloaded.

Disable Caching

  1. Open Ready Player Me > Settings.

  2. Uncheck Avatar caching enabled.

If caching is disabled, the Avatar Loader always downloads the avatar data from the Ready Player Me server and overwrites data stored on the client. Only one copy of the avatar is stored on the client and replaced on each avatar load request.

If different Avatar Configuration parameters are used for multiple avatar load requests, the parameter hash subfolder name will be replaced in the client-side cache storage.

Manage avatar cache data

You can use the following methods to clear the cache on-device for built applications.

  • AvatarCache.Clear()

  • AvatarCache.DeleteAvatarFolder(string guid)

To clear cache data manually in the Unity Editor, do one of the following.

  • Call AvatarCache.Clear()to clear all client-side cache or AvatarCache.DeleteAvatarFolder(string guid)to clear all client-side cache data for a specific avatar GUID.

  • Open Ready Player Me > Settings and click Clear local avatar cache.

  • Open Ready Player Me > Settings and click Reveal in Finder (Mac) or Show in Explorer (Windows) to go to the Avatars folder containing the data.

Unity Editor Avatar Loader never caches

Avatar caching is not supported when avatars are loaded via the Ready Player Me Avatar Loader window inside the Unity Editor.

When you download avatars using the Avatar Loader window, the avatar data is always downloaded from the server, and a single instance of the avatar data is stored in the project folder.

<Project Folder>/Assets/Ready Player Me/Avatars/

Each time a new avatar is requested, with or without new Avatar Configuration parameters, the stored avatar data is overwritten and the prefab is updated.

Examples

We recommend deleting any previously created cache after updating to the latest version of the Ready Player Me Unity SDK. See below for details.

See for more information and links to example code.

To get started with Avatar Caching support, see the Scenes included with the SDK at Assets/Samples/Ready Player Me Core/[VERSION_NUMBER]/AvatarLoadingSamples/AvatarLoading

👩‍💻
Load Avatars
Runtime Example
Manage avatar cache data
Avatar Configurations