-
What do you want to achieve?
I want to add accessories to a Dummy on client which is then parented to a Viewport. -
What is the issue?
The accessories are not showing up, after bringing the Dummy in the Workspace I noticed that the accessories are positioned well using a couple functions that I will point out but they don’t show up in the viewport. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
According to this post: Humanoid:AddAccessory does not work with FE from a LocalScript I found out that :AddAccesory can’t be used on the client so I’ve used the functions pointed out by TheGamer101 in the post but it seems that they are placed well on the Dummy but are not visible in the viewport.
Here’s the important part of the code that handles the viewport and the Dummy:
local function updateViewport(Model)
Viewport:ClearAllChildren()
local WorldModel = Instance.new("WorldModel")
WorldModel.Parent = Viewport
local Copy = Model:Clone() --- The Model I copy the Accessories from
local Clone = game:GetService("ReplicatedStorage"):WaitForChild("Dummy"):Clone()
Clone.Parent = game.Workspace
if Clone:FindFirstChild("Humanoid") then
Clone.Humanoid:RemoveAccessories()
for _, v in pairs(Copy:GetChildren()) do
if v:IsA("Accessory") then
addAccessory(Clone,v:Clone()) -- This is the addAccoutrement function from the post above, which welds the accessory locally to the Dummy
end
end
end
Clone.Parent = Viewport.WorldModel
end
I get the same result without using a WorldModel or parenting the clone to the workspace first.