local Players = game:GetService("Players");
local Dummy = workspace.Dummy; -- your dummy
local DummyHumanoid = Dummy.Humanoid; -- dummy's humanoid
Players.PlayerAdded:Connect(function(plr)
local humDes = Players:GetHumanoidDescriptionFromUserId(plr.UserId);
if(humDes)then
DummyHumanoid:ApplyDescription(humDes);
end
end)
loads the plr char on the dummy but when it loads, the accessories are placed incorrectly. How would I fix this?
The problem with accessories being placed incorrectly could be due to a mismatch in the orientation between the dummy’s root part and the player’s character. To resolve this issue, you can try adjusting the orientation of the dummy’s root part to match that of the player’s character.
Here’s an updated version of the code:
local Players = game:GetService("Players")
local Dummy = workspace.Dummy
local DummyHumanoid = Dummy.Humanoid
Players.PlayerAdded:Connect(function(plr)
local humDes = Players:GetHumanoidDescriptionFromUserId(plr.UserId)
if humDes then
DummyHumanoid:ApplyDescription(humDes)
-- Code to correctly position accessories
for i, accessory in pairs(plr.Character:GetChildren()) do
if accessory:IsA("Accessory") then
local clone = accessory:Clone()
clone.Parent = Dummy.Head
clone.Handle.CFrame = Dummy.Head.CFrame
end
end
end
end)
This code first applies the player’s HumanoidDescription to the dummy. Then, it loops through the player’s character’s children to check for any accessories. If it finds an accessory, it clones it and sets its parent to the dummy’s head. Finally, it sets the accessory’s Handle 's CFrame to match the dummy’s head CFrame .
This code should correctly position the accessories on the dummy. Lmk if the code works because I haven’t tested it out yet.
Hmmmm, there could be a few things causing the issue:
The clone of the accessory may not be positioned correctly, as the clone’s handle CFrame may not be set correctly.
The dummy’s head and the player’s character’s accessories may not be correctly aligned, as the dummy’s head and the player’s character’s accessories may have different sizes or shapes.
The player’s character’s accessories may be positioned differently based on the player’s animation, as different animations may affect the position of the accessories.
To troubleshoot this issue, you can try the following:
Print the values of the dummy’s head CFrame and the clone’s handle CFrame to see if they are correctly aligned.
Use the debugger to step through the code and inspect the values of the dummy’s head, the player’s character’s accessories, and the clone of the accessory to see if there are any issues with their positioning.
Try adding additional logic to account for differences in size or shape between the dummy’s head and the player’s character’s accessories.
If you still have issues could you please send more info about the problems you’re having, such as error messages or any other relevant info.
Yea it’s possible that a tool inside the dummy could affect where the accessories get placed. If the dummy has a tool equipped, it is possible that the tool is changing the position or orientation of the dummy’s head, which would affect the position of the accessories. You can try removing any tools from the dummy and see if that resolves the issue.
Edit: The code you posted only clones the accessories from the player’s character and sets their parent to the dummy’s head, but it doesn’t take into account any tools that the dummy may have.