local function loadImages()
local IDs = {
"http://www.roblox.com/asset/?id=111144469804988",
"http://www.roblox.com/asset/?id=73867945464814",
"http://www.roblox.com/asset/?id=123638460370012",
"http://www.roblox.com/asset/?id=94841909676652",
"http://www.roblox.com/asset/?id=94747138789104",
"http://www.roblox.com/asset/?id=135135026450497",
"http://www.roblox.com/asset/?id=96549073161631",
"http://www.roblox.com/asset/?id=135344714480892",
"http://www.roblox.com/asset/?id=86494747510639",
"http://www.roblox.com/asset/?id=94987789415917",
"http://www.roblox.com/asset/?id=99532975119608",
"http://www.roblox.com/asset/?id=84066209085445",
}
local function checkFailed(contentId, status)
if status == Enum.AssetFetchStatus.Failure then
print("Failed to load", contentId)
else
print("Success loaded", contentId)
end
end
ContentProvider:PreloadAsync(IDs, checkFailed)
end
Maybe I did it wrong? Can you show me what you meant by that?
You could potentially create a new decal for each image, creating a buffer of a frame or two, loading them with a transparency of 1 until switching to that decal, and then discarding them once you’re done with them.
maybe it doesn’t make a difference, but the official documentation preloads actual decals rather than ids.
can you see if making the IDs table a list of decals rather than ids changes anything?
you would take your list of ids, create a decal for each of them, set the transparency of each one to 1, and then when displaying that frame set the to transparency 0.
a mock up would look like this (thanks @Marked4Destruction for spotting an error)
-- Creating the decals --
local IDs = {
"http://www.roblox.com/asset/?id=111144469804988",
"http://www.roblox.com/asset/?id=73867945464814",
"http://www.roblox.com/asset/?id=123638460370012",
"http://www.roblox.com/asset/?id=94841909676652",
"http://www.roblox.com/asset/?id=94747138789104",
"http://www.roblox.com/asset/?id=135135026450497",
"http://www.roblox.com/asset/?id=96549073161631",
"http://www.roblox.com/asset/?id=135344714480892",
"http://www.roblox.com/asset/?id=86494747510639",
"http://www.roblox.com/asset/?id=94987789415917",
"http://www.roblox.com/asset/?id=99532975119608",
"http://www.roblox.com/asset/?id=84066209085445",
}
local partDecals = {}
for _, id in IDs do
local decal = Instance.new("Decal")
decal.Texture = id
decal.Transparency = 1
decal.Parent = part -- Set this to the part you are using
table.insert(partDecals, decal)
end
-- Displaying them --
local previousDecal = nil
for _, decal in partDecals do
decal.Transparency = 0
if previousDecal ~= nil then
-- We hide the previous frame after displaying the current frame, to try and reduce any possible stuttering
previousDecal.Transparency = 1
end
task.wait(0.1) -- The delay between frames
decal.Transparency = 1
previousDecal = decal
end
I was in the middle of mocking up a script, but you beat me to it
Don’t forget to set the decal’s Face when you create it.
Example:
decal.Face = Enum.NormalId.Top
I already have it so that only one decal object is used, and it will have the images being updated by changing the Texture property so that’s not really an option in my case. Is there any other way?
Could you try my method? I have never tried it, but I do believe it has a good chance of it working. I remember seeing a post about the same issue but for ImageLabels. Their solution was to keep it visible and to set to size to 0, 0 to hide it. The same idea could be used for this problem.
I also believe it works. My problem isn’t that your guys’s solutions aren’t working. It’s the fact that in my case, it would not be a good way of doing it
unfortunately, if it’s stuttering and PreloadAsync isn’t working, there isn’t much of an option other than using multiple decal instances to stop it.