I'm trying to create an object that will float above somebodies head, but when I do it always appears far off, directly behind the player. Can anybody tell me why this script doesn't work and point me in the right direction?
local bomb = script.Parent
local head = script.Parent.Parent
while wait(0.01) do
bomb.Position = head.Position + Vector3.new(0, 2, 0)
end
EDIT: Here's the script I'm using to spawn the bomb in at a certain time
if pwrup == "nuke" then
local char = workspace:FindFirstChild(player.Name)
local bomb = game.Lighting.Bomb:Clone()
bomb.Parent = char.Head
end
When I check the workspace the bomb is a child of my Head part, but the bomb just sits on the ground not doing anything.

6 comments
here's a gif of what happens https://gyazo.com/338427121eaaae5463e62e2849efb3e1
is it in the same spot every time? If so its likely the problem i've addressed (Its position is just being set to 0, 2, 0 because the values cant add). If not then im at a complete loss.
Yea, it's in that exact spot every time
ok then use my solution, it should work
Also another thing, never use workspace:FindFirstChild(player.Name) to get the Character of a player. If an object and a players name match then, problems. Use player.Character instead.
okay!