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.
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.
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.
You don’t have to adjust its CFrame, the weld will snap it into place.
Depends if you use a Weld or WeldConstraint I think. Weld will go into place, but I don’t think WeldConstraint does.
So how do I implement this to a script?
local glowingPart = game.ServerStorage.GlowingPart:Clone()
glowingPart.Parent = player.HumanoidRootPart
local weld = Instance.new("Weld")
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
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)
Can you tell me why you use WeldConstraint instead of Weld?
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
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
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)