SHORT QUESTION: Are there known preloadable Instances via ContentProvider:PreloadAsync() other than the basic/common ones?
LONG CONTEXT: READ BELOW
I’ve been playing around the ContentProvider’s preloading methods and techniques so I can apply the loading screen and its system to my game. Take a quick look at this part of an example module I wrote:
local contentPropertiesByClass = {
Decal = { "Texture" },
Texture = { "Texture" },
ImageLabel = { "Image" },
ImageButton = { "Image" },
MeshPart = { "MeshId", "TextureID" },
SpecialMesh = { "MeshId", "TextureId" },
Sound = { "SoundId" },
Animation = { "AnimationId" },
Sky = {
"SkyboxBk", "SkyboxDn", "SkyboxFt",
"SkyboxLf", "SkyboxRt", "SkyboxUp"
},
VideoFrame = { "Video" },
}
local function isValidContentId(value: any): boolean
return typeof(value) == "string"
and value ~= ""
and value ~= "rbxassetid://0"
and (
string.find(value, "rbxassetid://", 1, true) == 1
or string.find(value, "http://", 1, true) == 1
or string.find(value, "https://", 1, true) == 1
)
end
function module:IsInstancePreloadable(inst: Instance): boolean
if typeof(inst) ~= "Instance" or inst.Parent == nil then
return false
end
local props = contentPropertiesByClass[inst.ClassName]
if not props then
return false
end
for _, propName in ipairs(props) do
local ok, value = pcall(function()
return inst[propName]
end)
if ok and isValidContentId(value) then
return true
end
end
return false
end
Are there any known Instance classes that contains a property, with “content” value type (those strings that start with rbxassetid:// and similar links), that is preloadable via ContentProvider:PreloadAsync() ?
It’d be great help if you happen to know preloadable Instance classes other than listed in the module! I’d appreciate it if you would spare your time for a minute to tell me!
Note: I know every Instance classes are preloadable if they happen to contain a property whose value type is a content, but apparently there are some cases where the Instance class is actually not supported by ContentProvider:PreloadAsync() , despite containing that kind of property. In the official docs, Roblox team only stated 2 unpreloadable Instance classes, which are SurfaceAppearance and MaterialVariant. I’ve read through the DevForum and official docs multiple times and still didn’t found any extra information regarding this.
Thanks!