What do you want to achieve?
I’d like the “Name Tag” Gui that shows over the players head to stop moving around all over the place when walking/running/jumping.
What is the issue?
I’m not sure how to fix the Gui into place so that it doesn’t seemingly wobble around all over the place rather than just staying above the players head.
What solutions have you tried so far?
I have searched through here as well as YT and haven’t been able to find a solution to my problem.
P.S. I wasn’t able to upload the video example to here as the file is too big. If anyone has an idea as to what I’m trying to find a solution for though please feel free to comment here and share your thoughts.
this may work … really didn’t test it.
You will need to modify it to match the name of your tag.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local head = character:WaitForChild("Head")
local nameTag = head:WaitForChild("NameTag")
nameTag.Parent = head
nameTag.Adornee = head
nameTag.Position = UDim2.new(0, 0, 0, -head.Size.Y)
head:GetPropertyChangedSignal("Position"):Connect(function()
nameTag.Position = UDim2.new(0, 0, 0, -head.Size.Y)
end)
I’m pretty sure that this doesn’t change much because you’re still using the head, which position changes during the head bobbing. I think this is just something that billboard guis already do (updating their position when the position of their adornee changes)
Okay yeah, tbh I’m very stuck right now so will have to come back to this in the future. I think I’m just very confused with the scripting since it isn’t my script that I’m using as well so I don’t 100% understand what would need to be tweaked to make it less “wobbly” or just stay more in place.
Thank you both though! I’ll try figure out from what you guys have said how to edit the script so it’s not so weird when morphing lol.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local head = character:WaitForChild("Head")
local nameTag = Instance.new("BillboardGui")
nameTag.Parent = head
nameTag.Adornee = head
nameTag.AlwaysOnTop = true
-- Adjust the position if needed
nameTag.StudsOffset = Vector3.new(0, 2, 0) -- Example offset
local nameLabel = Instance.new("TextLabel")
nameLabel.Parent = nameTag
nameLabel.Text = "PlayerName" -- You can replace this with the player's name
nameLabel.Size = UDim2.new(0, 100, 0, 30) -- Adjust as needed
nameLabel.TextScaled = true
You can adjust the StudsOffset property to fine-tune the position of the BillboardGui.
Use RenderStepped for Positioning: Instead of relying on the GetPropertyChangedSignal("Position"), use RunService.RenderStepped to continuously update the position. This may provide smoother positioning.
local RunService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local head = character:WaitForChild("Head")
local nameTag = head:WaitForChild("NameTag")
nameTag.Parent = head
nameTag.Adornee = head
RunService.RenderStepped:Connect(function()
nameTag.Position = UDim2.new(0, 0, 0, -head.Size.Y)
end)
Also will look into this later when I can, I have to adjust the other devs script to something similar to this to see if it’ll work or try this in a separate game file so I can see how it works. Thank you for your help!