How can I insert a part that attaches to a player's Torso?

I want to insert a normal part with particles in it, and weld/attach it to the player’s torso so their body kind of “glows”. How would I be able to do this?

I haven’t thought of any way of doing it.

4 Likes

I mean it sounds like you already have the idea.

Make the part, make it have a SelectionBox or use the forcefield/neon material, cframe it to the torso, weld it to the torso.

2 Likes

You don’t have to adjust its CFrame, the weld will snap it into place.

2 Likes

Depends if you use a Weld or WeldConstraint I think. Weld will go into place, but I don’t think WeldConstraint does.

2 Likes

So how do I implement this to a script?

local glowingPart = game.ServerStorage.GlowingPart:Clone()
glowingPart.Parent = player.HumanoidRootPart
local weld = Instance.new("Weld")

1 Like

Look at the documentation next time.

local glowingPart = game.ServerStorage.GlowingPart:Clone()
glowingPart.Parent = player.HumanoidRootPart
local weld = Instance.new("Weld")
weld.Part0 = glowingpart.Parent
weld.Part1 = glowingpart
weld.Parent = glowingpart
1 Like

Something like this, if you want the part to be attached when the player joins and their character to spawn:

local glowingPart = game.ServerStorage.GlowingPart

local function onCharacterAdded(character)
	local ParticlePart = glowingPart:Clone()
	ParticlePart.CFrame = character.HumanoidRootPart.CFrame
	ParticlePart.CanCollide = false
	ParticlePart.Parent = character.HumanoidRootPart

	local Weld = Instance.new("WeldConstraint")
	Weld.Parent = character.HumanoidRootPart
	Weld.Part0 = ParticlePart
	Weld.Part1 = character.HumanoidRootPart
end

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end

game.Players.PlayerAdded:Connect(onPlayerAdded)
5 Likes

Can you tell me why you use WeldConstraint instead of Weld?

1 Like

Im just more used to use WeldConstraint than normal Welds, I like them, I dont have any specific reason, I just think those are more flexible.

You could read more about the differences by searching:

Depends on your project, take the desition fits your needs

2 Likes

Weld Cons dont need to have you manually set the C1 and the C0 of welds, basically it’s the easier alternative and just much more out of the box friendly

2 Likes

Assuming you’re using ParticleEmitters

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
for i,v in pairs(game.ServerStorage.GlowingPart:GetChildren()) do
if v:IsA("ParticleEmitter") then
v:Clone.Parent = character.Torso
end
end
end)
end)
2 Likes