So when I run this code, it works but, it makes the crown like 20 studs away from the player and is glitchy when the player moves.
local HatAttachment = script.Parent:FindFirstChild("HatAttachment")
local Handle = script.Parent
local Head = script.Parent.Parent.Parent:FindFirstChild("Head")
local Active = true
Handle.CFrame = Head.CFrame * CFrame.new(0, 0.5, 0)
while Active == true do
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.5, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.6, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.7, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.8, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.9, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 1, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.9, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.8, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.7, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.6, 0)
wait(0.1)
HatAttachment.CFrame = Head.CFrame * CFrame.new(0, 0.5, 0)
wait(0.1)
end
Should I use a different way to set the crown position or a better way to animate it? Along with any reason why the crown gets set far away from the player?

1 comment
I think it's better for you to use a weld for this instead since it's not an actual hat. Then use tweening to move it up and down.