Loading character appearance not in workspace?

The problem I’m facing is regarding having accessories in a humanoid character not positioning correctly when under a viewport frame.

Some background on the exact use case I’m going for:

I’m working on a plugin that allows you to use any character for testing in studio. Part of this plugin would allow the user to use a GUI to modify and preview character models that would be used. For the preview functionality I want to use a viewport frame to display the character. Currently the process I use is as follows.

  1. Select the character you’re previewing
  2. Find out if character is R15 or R6 and place the corresponding rig under viewport frame
  3. Apply the humanoid description with all the accessories to this rig.

Now here’s the problem since the rig is never at any point in the process placed under the workspace the accessories are not properly attached (position) to the character correctly. For example:

Capture

That “ball” is actually the character’s head and as you can see the limbs and hats are all over the place in the background.

Now the hacky solution to this would be to quickly parent the rig to the workspace, wait for the accessories to load, and then parent back to viewport frame. I would prefer not to do this however since I don’t want things popping in and out of the workspace if I can avoid it.

Another potential solution is to manually CFrame the accessories into place using the attachment information. This would work, expect for the limbs which sometimes seem to suffer from brick shift or in the case of mesh parts go to some random place entirely.

So I guess to make this a quick question. Is there any way to guarantee a character’s a appearance loads properly without having it at some point be parented to the workspace?

Here’s a place file if you want to play around with the problem. Click some of the names in the GUI to load the preview.

studio rigs.rbxl (104.6 KB)

3 Likes

This sometimes happens to me when I am creating custom NPCs. When I am editing, it shows properly and in test mode it shows properly, however when I go into the game on the website, the hats appear usually 5 or something studs above the head. After I go back into studio though, it shows. I change the accessory’s offset and that usually fixes it. I’m not sure how you would do this in a viewport frame, as I am not very familiar with them.