Hats created via script not appearing correctly on NPC

Hello! In my game I create and dress up NPCs via script. I have a problem where the items that are created are not positioned correctly on the NPC’s head. The problem only happens on certain items and I’ve tried doing possible solutions talked about in other threads, (like parenting to the workspace then the character, using humanoid description, and ApplyAccessory) but none of them seem to work.

I believe only certain hats cause this problem because taking off my backpack will make this problem go away.

Here is a screen shot of the problem:
image

Here is a screen shot of the function working as intended:
image

--// Dresses up the Character with the Specfied UserId. Basically gets the Character Apparance model then parents the hats to the character.
    function self:DressUpByUserId(Specified)
        local AppearanceModel = game.Players:GetCharacterAppearanceAsync(Specified)
        AppearanceModel.Parent = game.Workspace
        --// Delete useless stuff
        --// Add instances to CharacterAssets then parent to dummy
        for i,v in pairs(AppearanceModel:GetChildren()) do
            if v:IsA("Folder") then
                v:Destroy()
            else
                if v:IsA("Accessory") then
                    v.Handle.Massless = true
                end
                v.Parent = game.Workspace --// Possible solution I've tried
                v.Parent = self.CharacterInstance.Character --// This is the NPC
            end
        end
    end

If anyone has any idea on a possible solution, i’d love to hear it

1 Like

Have you tried possibly welding them and offsetting them into correct positions?

1 Like

That would be a last resort solution, as it would be extremely messy and would require me get the position info for probably thousands of hats.

2 Likes

Oh if you are doing it for thousands of hats, obviously not, I didnt know you were using a giant catalog, you should state that in your post, I will try and think of solutions, I am doing homework right now, if it is the backpack, why dont you just blacklist it or remove it? is it a big part of the game or a fundamental?

1 Like

I cant just create a blacklist of all the possible hats that have this problem. That would again, be messy as I’d have to go through and find the thousands of hats that have these problems.

I’m not the first person with this problem so I assume there is probably a far more elegant solution.

2 Likes

Well, are the characters and everything properly sized, for example, is their scaling different? Roblox might have an issue with that. And are they UGC items? Because items require proper scaling for roblox, I know @JohnDrinkin and other ugc modelers put lots of effort into scaling them properly, maybe those ones arent, but again, I doubt over a thousand items would be improperly scaled as I am pretty sure there is less than that in the UGC catalog.

Second of all, can you go into more detail of the solutions you have tried so far, it would help eliminate a lot.

1 Like

Everything is properly sized. I use the rigs directly from the “Rig Builder” that’s default in studio.

I’ve talked about the solutions I’ve tried in the original post. Please don’t keep flooding my post with extremely unhelpful posts to try to get marked as the solution.

2 Likes

I was saying that because from what I see you have only tried 1-2 solutions.

1 Like

I’ve tried all the solutions found in similar threads. Please stop spamming my thread.

2 Likes

Solution (thanks to UnderMyWheel):

Add all the attachments from a r15 rig into the r6 rig.
image
image

Or just use this R6 rig.
R6.rbxm (7.2 KB)