How do I force load a MeshPart and its texture on startup?

Hi everyone, I have a game that has a starting cutscene that looks at a MeshPart, but sometimes it appears grey or doesn’t appear at all for the first couple seconds. Is there a way to force load the mesh and its texture before the game starts? Any help is greatly appreciated, thanks!

ContentProvider:PreloadAsync

1 Like

Thanks! Should this be used in a server or local script? Or can it work in both?

Needs to be on the client, since it’s supposed to be preloaded on their machine

1 Like

It doesn’t seem to be working properly

local CP = game:GetService("ContentProvider")
local assets = {
	"rbxassetid://6282826785", --Model
	"rbxassetid://6282827453", --Texture
	"rbxassetid://6308615846", --ColorMap
	"rbxassetid://6308615530", --NormalMap
	"rbxassetid://6308615196" --RoughnessMap
}
local startTime = os.clock()
CP:PreloadAsync(assets)
local deltaTime = os.clock() - startTime
print(("Preloading complete, took %.2f seconds"):format(deltaTime))

It says complete in the console even though it hasn’t loaded the assets yet. Am I doing something wrong here?

You could try preloading the mesh instance itself (But not the SurfaceAppearance since it’s not supported), otherwise I cannot help

I did remove most of the things in assets from the last post because it was a lot, and it’s funny because it’s loading the parts with SurfaceAppearance, but not the main mesh I’m trying to load. I have also tried including the instance.

I made a workaround for this, I think it’s because it’s so close to the start of the game. I’m gonna add 5 seconds to the loading times. Thanks for your help!