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

How to CFrame a part to a players head?

I am using

CFrame.new(player.Character.Head.Position)

but that puts the item in question way off to the side of the head and elevated.

Also tried

Weld.C1 = player.Character.Head.CFrame

1 answer

✓ Accepted answer

To CFrame something to someone's Head/Torso etc., do the following:

local part = Instance.new("Part",player.Character) -- inserts a part to the player's character
part.CanCollide = false -- you don't need this
part.Anchored = false -- has to be unanchored
part.CFrame = player.Character.Head.CFrame -- makes it the same as the head in positioning and rotation
local weld = Instance.new("Weld",player.Character.Head) -- new weld inside Head
weld.Part0 = part
weld.Part1 = player.Character.Head
weld.Name = "Head-" ..part.Name.. "Weld"

Welds make something stay in place relative to the player.

3 comments

0

The Item is a model and Im moving the C0 CFrame to the head position not a single part but I welded the part together to a part known as CoreWeld which is the main weld

0

You could try welding all of the parts in the model, then moving the primary part to the head?

0

idk this is a bit too complicated for me as of yet, hope I helped somehow :P

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