Hello,
I am trying to use PreloadAsync
to preload a texture, but it doesnt seem to work correctly. When I use this example from ContentProvider | Documentation - Roblox Creator Hub, it works correctly and the function Load
is called:
local ContentProvider = game:GetService("ContentProvider")
local function Load(contentID, status)
print("loaded")
end
local logoId = "rbxassetid://658743164"
local pageTurnId = "rbxassetid://12222076"
local decal = Instance.new("Decal")
decal.Texture = logoId
local sound = Instance.new("Sound")
sound.SoundId = pageTurnId
local assets = { decal, sound }
ContentProvider:PreloadAsync(assets,Load)
However, if I change it to be local assets = { decal }
, the function is not called. Conversely, if I change it to be local assets = { sound }
it is called.
I do not fully understand how to use PreloadAsync, and the documentation has not been much help. Could anyone explain why this is happening?