Delay with character model in a viewportframe

I’m trying to use the player’s character model to play an animation in a viewportframe on their playergui

However, when using the code below to generate a model of the player’s character:

local model = game:GetService("Players"):CreateHumanoidModelFromUserId(userid)

There is always a noticable delay before the model is generated and appear on the ui

Is there a way to get rid of this delay or another way to create a model of a player’s character?

1 Like

In what method are you updating the viewport frame? Maybe try changing the method

ex:)if youre using a while loop or something, maybe try updating the viewport frame using something like runservice renderstepped? I don’t really know much about all this runservice stuff so I might be wrong

2 Likes

No, I only have the character model under a worldmodel under the viewportframe, there aren’t any other updates to it.

Also I have noticed that the delay only exists when using the code in my original post to create the character. So I’m wondering if there are any other ways to create a model of a player’s character?

Have you tried using a dummy rig (simple blocky rig for r6 / r15) and applying the player’s character appearance on it?

Yes, I’ve tried using Humanoid:ApplyDescription() on a dummy that is already present in the ui and the delay still exists due to game.Players:GetHumanoidDescriptionFromUserId(id).

My only solution would be cloning the player character as soon as the player joins and caching it in server storage or wherever you would want to store it, therefore the humanoid description should only be applied once and you can access the character at any time.

Maybe you could try prioritizing the character and stuff by placing everything related to the viewportframe into ReplicatedFirst? I never used it so I might be wrong.

Preparing the appearance of the player before it was needed on the ui worked and caused no delay for when it was actually used!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.