I tried to make a yellow ball which i stored in lighting hover over the player's head when they touch a brick, however, the ball welds to a strange place several studs behind and under the player's torso. Here's my code:
brick = script.Parent brick.Touched:connect(function(h) ishuman = h.Parent:FindFirstChild('Humanoid') if ishuman then p = game.Lighting.a:Clone() p.Parent = game.workspace s = Instance.new("Weld") s.Parent = h.Parent.Torso s.Part0 = h.Parent.Torso s.C0 = h.Parent.Torso.CFrame:inverse() s.Part1 = p s.C1 = p.CFrame:inverse() p.CFrame = h.Parent.Torso.CFrame * CFrame.new(0,3,0) end end)
You can try using the toObjectSpace and toWorldSpace CFrame methods to achieve the result your looking for. CFrames are picky.. and the simplest things are hard to do. So I wouldn't be of much help.