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

Positioning this brick doesn't work?

I have a localscript inside StarterGui with a part inside it called 'Health' with a billboard gui inside. I am trying to weld it to the players head then move it up 10 studs. It succesfully welds to the players head but at the origin of the head. How could I fix this? I have tried:

gui.CFrame = playershead.CFrame + Vector3.new(0,10,0)

My code -

wait(1)
local camera = game.Workspace.CurrentCamera
local playershead = game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name).Head
local gui = script.Health
gui.Parent = camera
gui.Position = playershead.Position + Vector3.new(0,10,0)
local weld = Instance.new("ManualWeld")
weld.Parent = gui
weld.Part0 = gui
weld.Part1 = playershead

1 answer

You need to use

weld.C0 = CFrame.new(playershead.Position.X, playershead.Position.Y+10, playershead.Position.Z) 

instead of gui.Position

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