Content Provider stuck, when playing through the Roblox

  1. I want to make Content Provider work clearly.

  2. So, I tried to test my game through the the Roblox, and saw issue:

ContentProvider stuck on SharedTableRegistry.
3. I’ve tried debbug, but sound like all works clearly.


It looks like it just won’t load. BUT in fact it loads perfect in Studio make this issue weird.
Here is the code:

 local callback = function(assetId, assetFetchStatus)
	print("PreloadAsync() resolved asset ID:", assetId)
	print("PreloadAsync() final AssetFetchStatus:", assetFetchStatus)
end

local startTime = os.clock()
for i = 1, #Assets do
	local asset = Assets[i]
	local fill = UI:WaitForChild("Main"):WaitForChild("LoadingBar"):WaitForChild("Fill")
	local loading = UI:WaitForChild("Main"):WaitForChild("LoadingBar"):WaitForChild("loading")
	local yes = i

	ContentProvider:PreloadAsync({asset}, callback)
	loading.Text = `Asset preloading: {asset.Name}, {i} / {#Assets}`
	fill.Size = UDim2.new(i/#Assets, 0, 1, 0)
end
1 Like

I had the same issue with my loading for some reason.

I don’t really know the issue to it, but I just wrapped it in a pcall and it seemed to fix it for me.

This was my code

for i, v in pairs(AssetsToLoad) do
		local Percent = (i / #AssetsToLoad)
		local GradientTween = TweenService:Create(Gradient, GradInfo, {
			["Offset"] = Vector2.new(0, -Percent + 0.2)
		})
		
		GradientTween:Play()
		
		local Type = v.Name
		
		Label.Text = tostring(string.format('Loading asset: <font color="#3853ff">%s</font> (%s', v.Name, tostring(math.floor(Percent * 100)) )) .. "%)"
		
		pcall(function()
			ContentProvider:PreloadAsync({v})
		end)
		
		if GradientTween.PlaybackState == Enum.PlaybackState.Completed then
			continue
		end
		
		GradientTween.Completed:Wait()
	end