I’ve been trying to fix this issue for a while now, the Npc just goes grey for a few seconds then loads in. I want it to load right as it spawns because it isn’t even a player.
how could I fix this?
(Framerate might be low but it’s grey for a while)
Watching this, I am wondering in regards to your code structure how exactly this NPC is spawned and loaded in.
If this NPC is transferred from ServerStorage and cloned to the Client, then I would imagine that could be a potential reason as the client might not have loaded in the properties of that NPC in time for when it was needed (Which is where maybe you’d need to give more time between the spawning and triggering of the animation so that the NPC could fully be loaded in) or you could also preload the NPC and its clothing using AssetService:PreloadAsync()
I cloned it from the ReplicatedStorage, I’ve tried to preload everything inside of it and it somehow still doesn’t work. It doesn’t have any clothing, it’s just recolored limbs with a mask welded on to it
I personally think it could very well be with regards to how you approached it (Mainly with you mentioning that it was cloned).
I have two ideas in mind, but I am not fully certain of the success rate of both approaches. There is storing the NPC instead somewhere in the workspace (just hidden away from the player) and either cloning it or simply changing the position of the HumanoidRootPart of the NPC when you need it. There is also the code approach where you may need to stall the code between the time it has to be spawned/loaded to the point where the animation has to be played (Like imagining a 1-2 second pause to check or ensure the model is properly loaded). You could try both and see how they play out.