Particle Won't Emit

I have a script everything works but the particleEmitter won’t emit when parented to the torso.

–The script

local function WeaponFire(player, mouseHit)
	local result = workspace:Raycast(tool.Weapon.Barrel.Position, (mouseHit - tool.Weapon.Barrel.Position).Unit * 1000)	
	if result then
		if result.Instance.Parent:FindFirstChild("Humanoid") then
			local hum = result.Instance.Parent:FindFirstChild("Humanoid")
			local humRootPart = hum.Parent:FindFirstChild("Torso")
			local Particle = game.ReplicatedStorage.ParticleEmitter:Clone()
			Particle.Parent = humRootPart
			hum.Health -= 10
			task.wait(0.2)
			Particle:Destroy()
		end
	end
end


tool.Equipped:Connect(Anim)
game.ReplicatedStorage.WeaponEvent.SMG.OnServerEvent:Connect(WeaponFire)

(This is a snippet of the scripts but i only included the important parts)

2 Likes
  1. Your variable is humRootPart - I assume you are trying to get the HumanoidRootPart which exists for both R6 and R15 rigs, not Torso which only exists for R6 rigs. This means this variable can return nil, and you are setting the Particle.Parent to nil.
  2. Ensure your particle’s rate is above 0.
  3. Ensure your graphics quality is high enough to see the particles.
3 Likes

im using r6 rigs and i have it print the parent, the particle rate is above zero, my graphics are high enough to see the particles.

1 Like

Instead of cloning a new particle emitter into the part every time, have you tried storing one emitter in the part and using ParticleEmitter:Emit() every time you want to use it? This would both be more efficient and more simple.

3 Likes

I don’t see the :Emit() function in the script? Or is the particle enabled?

got it figured out, thats what i needed to do

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.