Decals do have 'loading' delays

Salutations,

I have encountered an issue with decals.
Whenever the script is run, the decals change each 0.2 seconds to its decal asset.
However in between the cycle Walking1ID & Walking2ID, the decal ‘loads’ approximately about 0.05 seconds.

To enlighten;

StandingID

image

Walking1ID

image

The issue: ( Approx. 0.05 seconds once Walking2ID is supposed to load )

image

Walking2ID

image

Here’s the script anyway:

--------------------------
StandingID = "rbxgameasset://Images/gacha1_normal"
Walking1ID = "rbxgameasset://Images/gacha1_animation"	
Walking2ID = "rbxgameasset://Images/gacha1_animation2"	
--------------------------


--------------------------
local running = false
local betweencycle = false
local go = false

local hum = script.Parent.Parent:FindFirstChild("Humanoid")
local pose = script.Parent:FindFirstChild("PoseBool")
local df = script.Parent.DecalFront
local db = script.Parent.DecalBack
--------------------------


--------------------------
function Move(speed)
	 if speed > 0 then
		running = true
	else
		running = false
		df.Texture = StandingID
		db.Texture = df.Texture
	end
end
--------------------------



if game.Players:FindFirstChild(script.Parent.Parent.Name) ~= nil then
	go = true
end



while go do 
	
	hum.Running:connect(Move)
	
	wait(0.2)
	
	if running and pose.Value == false then 
		
		if df.Texture == StandingID then
			
			df.Texture = Walking1ID
			
		elseif df.Texture == Walking1ID then
			
				df.Texture = Walking2ID
				
				betweencycle = true
				
		elseif df.Texture == Walking2ID and betweencycle == true then

				df.Texture = Walking1ID
				
				betweencycle = false

		end
	end 

	db.Texture = df.Texture

end 

Any assumptions or hints? Please let me know!

1 Like

Have you tried using the ContentProvider:PreloadAsync method to preload the images? The “delay” is probably because the images aren’t downloaded yet.

The method takes an array of IDs, so you can just pass it the IDs you’ve already defined in an array.

game:GetService( 'ContentProvider' ):PreloadAsync( {
    StandingID,
    Walking1ID,
    Walking2ID,
} )

Preload them before you need them. If it’s just the three images then doing it when the player first joins in a LocalScript is easiest.

3 Likes