🍀 Assets
Retrieve Assets Data from Asset Packs.
🎒 Examples
(Assets.LoadAsync) Loads a Skeletal Mesh before attaching it
Assets.LoadAsync("my-asset-pack::SK_MyHair", AssetType.SkeletalMesh, function(success)
if (success and character:IsValid()) then
character:AddSkeletalMeshAttached("hair", "my-asset-pack::SK_MyHair")
end
end)
(Assets.Precache) Precaches a Static Mesh
Assets.Precache("my-asset-pack::SM_MyStaticMesh", AssetType.StaticMesh)
🗿 Static Functions
| Returns | Name | Description | |
|---|---|---|---|
| table of table | GetAnimations | Gets a list containing all Animation Assets Keys from an AssetPack | |
| table of table | GetAssetPacks | Gets a list containing information about all loaded Asset Packs | |
| string | GetAssetPath | Gets the file path of an asset | |
| table of table | GetBlueprints | Gets a list containing all Blueprints Assets Keys from an AssetPack | |
| table of table | GetMaps | Gets a list containing all Map Asset Keys from an AssetPack | |
| table of table | GetMaterials | Gets a list containing all Materials Asset Keys from an AssetPack | |
| table of table | GetOthers | Gets a list containing all Other Assets Keys from an AssetPack | |
| table of table | GetParticles | Gets a list containing all Particle Assets Keys from an AssetPack | |
| table of table | GetSkeletalMeshes | Gets a list containing all Skeletal Mesh Asset Keys from an AssetPack | |
| table of table | GetSounds | Gets a list containing all Sound Assets Keys from an AssetPack | |
| table of table | GetStaticMeshes | Gets a list containing all Static Mesh Assets Keys from an AssetPack | |
| boolean | IsLoaded | Returns if an Asset is already loaded and cached | |
LoadAsync | Loads an Asset in the background, so spawning or attaching it later does not freeze the game | ||
Precache | Manually adds an Asset to be loaded during the Player's loading screen |
Slow

GetAnimations
Gets a list containing all Animation Assets Keys from an AssetPack
local ret = Assets.GetAnimations(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetAssetPacks
Gets a list containing information about all loaded Asset Packs
local ret = Assets.GetAssetPacks()
Returns
| Type | Description |
|---|---|
| table of table | List containing information about all loaded Asset Packs with this format |
Moderate

GetAssetPath
Gets the file path of an asset
local ret = Assets.GetAssetPath(asset, asset_type)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset | Required parameter | The asset reference in the format asset-pack::AssetKey |
| AssetType | asset_type | Required parameter | The Asset Type |
Returns
| Type | Description |
|---|---|
| string | The file path defined in the Assets.toml |
Slow

GetBlueprints
Gets a list containing all Blueprints Assets Keys from an AssetPack
local ret = Assets.GetBlueprints(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetMaps
Gets a list containing all Map Asset Keys from an AssetPack
local ret = Assets.GetMaps(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetMaterials
Gets a list containing all Materials Asset Keys from an AssetPack
local ret = Assets.GetMaterials(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetOthers
Gets a list containing all Other Assets Keys from an AssetPack
local ret = Assets.GetOthers(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetParticles
Gets a list containing all Particle Assets Keys from an AssetPack
local ret = Assets.GetParticles(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetSkeletalMeshes
Gets a list containing all Skeletal Mesh Asset Keys from an AssetPack
local ret = Assets.GetSkeletalMeshes(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetSounds
Gets a list containing all Sound Assets Keys from an AssetPack
local ret = Assets.GetSounds(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Slow

GetStaticMeshes
Gets a list containing all Static Mesh Assets Keys from an AssetPack
local ret = Assets.GetStaticMeshes(asset_pack_path)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_pack_path | Required parameter | The Asset Pack path to get the assets |
Returns
| Type | Description |
|---|---|
| table of table | array of tables containing all assets and its metadata with this format |
Optimal

IsLoaded
Returns if an Asset is already loaded and cached.
An Asset counts as loaded once an entity, an attached mesh orAssets.LoadAsyncloaded it during this session, as the type it was loaded as.
local ret = Assets.IsLoaded(asset_path, asset_type)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_path | Required parameter | The asset reference in the format asset-pack::AssetKey |
| AssetType | asset_type | Required parameter | The Asset Type |
Returns
| Type | Description |
|---|---|
| boolean | If the asset is loaded |
Optimal

LoadAsync
Loads an Asset in the background, so spawning or attaching it later does not freeze the game.
Entities and attached meshes load their assets right away when created, which can freeze the game for a moment when the asset is big or many are created at once (e.g. dressing several Characters with AddSkeletalMeshAttached).
The asset stays loaded and cached afterwards. Loading the same asset again while it is still loading waits for the same request. The callback always runs on a later tick, never inside this call, even when the asset was already loaded.
Assets.LoadAsync(asset_path, asset_type, callback?)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_path | Required parameter | The asset reference in the format asset-pack::AssetKey |
| AssetType | asset_type | Required parameter | The Asset Type |
| function | callback? | nil | Called when the asset finished loading with this format |
Assets.LoadAsync Examples
Loads a Skeletal Mesh before attaching it
Assets.LoadAsync("my-asset-pack::SK_MyHair", AssetType.SkeletalMesh, function(success)
if (success and character:IsValid()) then
character:AddSkeletalMeshAttached("hair", "my-asset-pack::SK_MyHair")
end
end)
Optimal

Precache
Manually adds an Asset to be loaded during the Player's loading screen
Assets.Precache(asset_path, asset_type)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | asset_path | Required parameter | The Asset Key |
| AssetType | asset_type | Required parameter | The Asset Type |
Assets.Precache Examples
Precaches a Static Mesh
Assets.Precache("my-asset-pack::SM_MyStaticMesh", AssetType.StaticMesh)


