Cant equip layered clothes on the client to NPCs

How can I equip layer clothes properly to NPCs?
This is what happens when I try
image

I obviously cant use AddAccessory on the client and this is my custom function to equip normal accessories:

local function CFrameAccessoryToCharacter(characterModel, accessory)
	local accessoryAttachment = accessory:FindFirstChildWhichIsA("Attachment", true)
	if not accessoryAttachment then
		warn("No attachments found in accessory. Accessory was not attached.")
		return
	end

	local attachmentName = accessoryAttachment.Name
	local attachTo = characterModel:FindFirstChild(attachmentName, true)
	
	if not attachTo or not attachTo:IsA("Attachment") then
		warn(string.format("No attachment named %s found in character. Accessory was not attached.", attachmentName))
		return
	end

	local Handle = accessory:FindFirstChild("Handle")
	if not Handle then
		warn("Attachment has no handle. Accessory was not attached.")
		return
	end

	accessory.Parent = characterModel

	Handle.CFrame = attachTo.WorldCFrame * accessoryAttachment.CFrame:Inverse()

	local weld = Instance.new("WeldConstraint")
	weld.Parent = Handle
	weld.Part0 = Handle
	weld.Part1 = attachTo.Parent
end```

Weird enough this is the only layered clothing accessory in my game that his this issue when being equipped via that function. All other layered coats, boots, etc equip fine with no issues.

You mean, because its not possible to use AddAccessory on ClientSide, you created a Client Side script to add accessories?
Is there a special reason for that? like, you dont want other players see what you are wearing?

Otherwise, you should handle the AddAccessory on ServerSide, or others wont see the changes.

What you mean by Layered Cloths? the real LayeredClothes that fits the avatar mesh? or just normal accessories? If those are the real Layered, then changing the Layer and Puffiness properties of the WrapLayer its maybe what you are looking for.

1 Like

yes they are real layered clothes. And yea part of the reason is that I dont want other players to see also the fact that the menu screen pans into a massive palace which lets you view your characters and loads their armor and accessories. Every characters camera gets sent to the same palace which is also another reason I set the accessories on the client.

1 Like

Oh got it! makes sense, then

If that layered item is properly set as the others in your game, but its getting “big” or weird, its because its in the same layer as another layered item, try changing the Layer property in its WrapLayer same for puffiness.

1 Like

May also be worth noting I have tried playing around with the wraplayer properties. The ONLY property that does something is the CageOrigin. When I change the position even by 0.01 it actually fixes the issue.
image
Why isn’t this the solution? Scripts changing CageOrigin position is forbidden.

I tried adjusting puffiness and nothing changed. Does puffiness have to be set before its “equipped” and I am assuming the “Order” property is the wrap layer? Adjusting that also didnt do anything.

Yeah, it works funny, the Order is how the Puffiness will be applied… its weird to explain.

The puffiness of a layer(order) will impact the scale of the the next layer(order)

The best you can do to get it, is place 3 layered, set its order ascending, then play with the puffiness of each one, and you’ll see how it affects the next layers but not backwards

1 Like

I tried removing all other layered clothing (just the boots) and the issue still occured
image
Are you sure it has something to do with multiple layered clothing? Still gonna try to play with the order and puffiness though.

Nope, I cant be sure if thats the issue, cause Im not testing it myself by trying to apply it into a character, could be the item itself not having the proper setup to work, as you said, its the only one item that its working funny in the game

1 Like

It was inserted with insert service off the catalog though. Surely it couldn’t be messed up. Nothing seems different about it compared to other layered clothes. (No missing wraplayers or anything)

oh, thats great, its possible you give me the ID of that catalog item? I could test it too

1 Like

Took me a minute to find! This is the link to the accessory

I did find that I could subtract 0.01 from the cageorigins Y position manually instead of trying to do it from a script and it solves my issue. However thats kinda hacky and also very weird that very slightly adjusting the cageOrigin fixes it so I will mark this as a temporary solution but if a better one is found I will mark that.

1 Like

Well it looks that doesnt fit on any character
image

Should be as stated in description:
image

But I think you already know that, I think the issue was not on your side, glad you fixed it!

2 Likes

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