Hello developers.
I need Help.
I want the player’s name to be on his jersey.
In studio I obtain good results manually on different models but I cannot find the method to automate it with a script.
I want to place a part close to a layercloth shirt.
This part is in the ReplicatedStorage (partName) and contains a surfaceGui with a textLabel.
This script is almost okay but doesn’t work with all the characters. (images are from the same script)
for _, character in pairs(workspace.Folder:GetChildren()) do
local handle = character:WaitForChild("Shirt"):WaitForChild("Handle")
local torso = character:WaitForChild("UpperTorso")
local partName = rep.PartName:Clone()
partName.Size = torso.Size
partName.CFrame = torso.CFrame * CFrame.new(0,0, .05) -- how to calculate this?
partName.WeldConstraint.Part1 = torso
partName.Parent = torso.Parent
end
Do you see how to calculate the offset CFrame or do you have other solutions?