You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
Aligned Hair in a Dummy.
What is the issue?
Unaligned hair after I use Humanoid:AddAccessory(HatAccessory)
The Dummy is constantly rotating because of BodyAngularVelocity.
What solutions have you tried so far?
I can’t think of anything because this is my first time making like this.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local newAsset = HairTable[HolderValue.Value].Value:Clone()
--newAsset.Parent = CharacterDummy
CharacterDummy.Humanoid:AddAccessory(newAsset) --// The equip method
local newWeld = Instance.new("WeldConstraint")
newWeld.Part0 = CharacterDummy.Head
newWeld.Part1 = newAsset.Handle
newWeld.Parent = newAsset.Handle
Off-topic:
How do I rotate an NPC with anchored HumanoidRootPart? because I use unanchored HumanoidRootPart to rotate it with BodyAngularVelocity. But what if an exploiter found the Dummy and pushed it around, the Dummy would be in a different location. What’s the better way to it?
Here try this, there is a built in function in the humanoid called AddAccessory(). This is how you would use it. This seems to work for me, I put all of this code on the server and started spinning around and the hat loaded perfectly. I would test that is being shown on the server and on the client.
local humanoidObj = nil --Set this as the player's humanoid
local accessoryInstance = nil --the accessory you are attaching to the character
humanoidObj:AddAccessory(accessoryInstance) --adds the accessory to the humanoid
I used this code to test.
game.Players.PlayerAdded:Connect(function(p)
local c=p.Character or p.CharacterAdded:Wait()
local h=c:WaitForChild("Humanoid")
wait(3)
local itemModel = game.InsertService:LoadAsset(6352107732):GetChildren()[1]
h:AddAccessory(itemModel)
end)
The accessory is unanchored and this is all done on the Server, if you didn’t catch the InsertService.
I would just have the dummy only exist on the client. Even if the exploiter found that it was unanchored, then he wouldn’t be able to shove it in front of other people.