Avatar caching
Store avatar assets and data locally.
Last updated
Store avatar assets and data locally.
Last updated
The Ready Player Me SDK provides an avatar caching functionality. If avatar caching is enabled, every time an avatar is loaded, the 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.
If a Ready Player Me user makes a change to an existing avatar, such as altering the 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.
Avatar caching is available at runtime and includes support for Avatar Configurations.
Avatar caching is disabled by default. To enable avatar caching, do the following:
Open Edit > Project Settings.
In the Game section, select Ready Player Me.
Check Enable Avatar Caching.
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>/
At runtime, when caching is enabled, 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 Config 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 load 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.
Open Edit > Project Settings.
In the Game section, select Ready Player Me.
Uncheck Enable Avatar Caching.