I have a decal’s image being swapped between multiple IDs. However, in between each change the decal is blank. I’m aiming for a seamless transition.
Code:
local ContentProvider = game:GetService("ContentProvider")
local Assets = {"rbxassetid://00000", "rbxassetid://00001", "rbxassetid://00002", "rbxassetid://00003", "rbxassetid://00004", "rbxassetid://00005", "rbxassetid://00006", "rbxassetid://00007", "rbxassetid://00008", "rbxassetid://00009"}
local Decal = script.Parent.ImageLabel
ContentProvider:PreloadAsync(Assets)
for i = 1, 10 do
Decal.Image = Assets[i]
wait(1)
end
I’ve thought about creating a second imagelabel, making it transparent and then using that to pre-load the decals and then toggling between the two, but it seems kinda overboard.
PreloadAsync will make sure the client has the data it needs to construct each image, but I’m not sure how directly that correlates to making sure the image is ready to use in the client’s RAM until it is first accessed.
How high-resolution are your images? If they are fairly low-resolution, you could stitch them into one sprite sheet and move through it by changing the ImageLabel’s ImageRectOffset.
You could also try binding the transition to RenderStepped, but I don’t know if that will help. Your suggestion, while overboard, should work.
The images are high resolution. I guess I’ll throw in a second imagelabel.
I hadn’t considered a sprite sheet yet, I wonder if making it more low-res will make up for itself in organization and function. I’ll have to experiment some more. Thanks for your help.