Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a hat move lower then where it is usually supposed to be?

I am trying to move a hat a bit lower down a players body but it does not work.

This is the script:



wait()
buff = game.ReplicatedStorage.buff:Clone() -- Wherever your hat is stored.

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
  
buff.Parent = character
buff.Handle.CFrame = buff.Handle.CFrame + Vector3.new(0,5,0)
print(5)
    end)
end)

It doesn't work and the hat stays in its original position. Please help! This is the hat I am using: https://www.roblox.com/catalog/62745127/Thug-Bandana

1 answer

✓ Accepted answer

Roblox hats are joined to the character's body parts via WeldConstraints. Setting the CFrame of the handle part doesn't alter the offset relation contained in the WeldConstraint.

You'll want to make these changes via properties in the Accessory instance itself (the hat)

Here's a picture of those properties where red effects position and blue effects rotation

It's worth noting that these 3 Vec3 properties exist as the resulting homogeneous CFrame components describing the weld.

Edit:

They're no longer using these properties by default, instead overriding them in situations where an attachment in the hat's Handle exists and matches the name of an attachment in one of the character's limbs. The weld offset is then positioned so that the Handle's attachment bears the identical CFrame of the limb attachment.

You'll want to assign to the Position property of the attachment that is a child of the hat's Handle part.

Here's a screenie with both matching attachments selected

10 comments

0

damn i got none of that

0

so C0?

0

Yep they're combined to create the resulting C0 CFrame, altho that's maintained internally with WeldConstraints and cannot be assigned to.

0

This doesn't work: buff.AttachmentUp = Vector3.new(0,55,0) also, your picture does not work

0

This doesn't work: buff.AttachmentUp = Vector3.new(0,55,0) also, your picture does not work

0

Fixed the image URL. 'AttachmentUp' describes the Up unit vector component of the cframe, which describes rotation not position. As it's a unit vector, {0,55,0} is not valid and will be normalized to {0,1,0}.

0

how should it be? sorry im stupid

0

What you're looking for is the positional component of the CFrame, AttatchmentPos in this case.

0

oof

0

this does not work also: buff.AttachmentPos = Vector3.new(0,55,0)

This discussion is preserved as it was. New answers, comments, and votes are closed.