Questions about Preload

So what does PreloadAsync work for? I know Decals and Images…
but does it work for.
Animations and Sounds?

It works for animations, sounds, images, meshes, particles > all that Jazz

Particles are images whoops (30)

Anything that is linked to the roblox website like having an ID:
rbxassetid:// or etc.

So the Animations are preloaded but they’re being errored with a

- Image "https://assetdelivery.roblox.com/v1/asset?id=656118852" failed to load in "TextureManager::PreloadTexture": Failed to resolve texture format | 3c 72 6f 62 6c 6f 78 21 89 ff 0d 0a 1a 0a 00 00 03 00 00 00 ef 00 00 00 00 00 00 00 00 00 00 00 49 4e 53 54 29 00 00 00 4d 00 00 00 00 00 00 00 f0 03 00 00 00 00 08 00 00 00 4b 65 79 66 72 61     <roblox!��..........�...........INST)...M.......�.........Keyfra
19:03:56.074 - ContentProvider:PreloadAsync() failed for rbxassetid://656118852
19:03:57.243 - Image "https://assetdelivery.roblox.com/v1/asset?id=656121766" failed to load in "TextureManager::PreloadTexture": Failed to resolve texture format | 3c 72 6f 62 6c 6f 78 21 89 ff 0d 0a 1a 0a 00 00 03 00 00 00 22 01 00 00 00 00 00 00 00 00 00 00 49 4e 53 54 25 00 00 00 59 00 00 00 00 00 00 00 f0 03 00 00 00 00 08 00 00 00 4b 65 79 66 72 61     <roblox!��.........."...........INST%...Y.......�.........Keyfra
19:03:57.260 - ContentProvider:PreloadAsync() failed for rbxassetid://656121766
19:03:57.494 - Image "https://assetdelivery.roblox.com/v1/asset?id=5057749643" failed to load in "TextureManager::PreloadTexture": Request failed
19:03:57.525 - ContentProvider:PreloadAsync() failed for rbxassetid://5057749643
19:03:57.748 - Image "https://assetdelivery.roblox.com/v1/asset?id=5069155413" failed to load in "TextureManager::PreloadTexture": Request failed
19:03:57.787 - ContentProvider:PreloadAsync() failed for rbxassetid://5069155413

A tad difficult to tell whats going on in that however, preload tries to load in images, it won’t always succeed in doing so, you could try doing a repeat on it and force it to actually load, but if the images don’t exist, they won’t load.

Well this is what I have.,

local Player = game:GetService("Players").LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ClearUiEvent = ReplicatedStorage:WaitForChild("Events", 60).ClearLoadingUI
local ContentProvider = game:GetService("ContentProvider")
local Assets = require(ReplicatedStorage:WaitForChild("Assets", 60))
local LoadingGui = Player.PlayerGui:WaitForChild("LoadingGui", 60)
local LoadingBar = LoadingGui.Background.Loading.Main.Bar
local AssetCountLabel = LoadingGui.Background.Loading.AssetCount

local TotalAssetsLoaded = 0
AssetCountLabel.Text = "Loaded Assets: " .. TotalAssetsLoaded .. "/" .. #Assets.Ids
for _, Asset in ipairs(Assets.Ids) do
	local Success
	while not Success do
		Success = pcall(function()
			ContentProvider:PreloadAsync({Asset})
		end)
		wait()
	end
	if Success then
		TotalAssetsLoaded = TotalAssetsLoaded + 1
	
		LoadingBar.Size = UDim2.fromScale(TotalAssetsLoaded/#Assets.Ids, 1)
		AssetCountLabel.Text = "Loaded Assets: " .. TotalAssetsLoaded .. "/" .. #Assets.Ids
	end
end

if TotalAssetsLoaded == #Assets.Ids then
	ClearUiEvent:Fire()
end

Actually I moved the IDs, to an actual Animation in the ModuleScript that holds all the IDs, and then referenced those in the list, that seems to actually load.

image

local Assets = {}

Assets.Ids = {
	-- ...
	script.RunAnimation,
	script.WalkAnimation,
	script.JumpAnimation,
	script.FallAnimation
}

return Assets
1 Like