Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to CFrame a part to a players head?

Asked by
Voltoxus 248 Moderation Voter
8 years ago

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

Log in to vote
0
Answered by 8 years ago

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.

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 Voltoxus 248 — 8y
0
You could try welding all of the parts in the model, then moving the primary part to the head? TheDeadlyPanther 2460 — 8y
0
idk this is a bit too complicated for me as of yet, hope I helped somehow :P TheDeadlyPanther 2460 — 8y
Ad

Answer this question