Particles not emitting when using :Emit()

I made this event that emits particles on the client (I do :FireAllClients() for this), and everything’s going through properly. However, it’s not emitting.

Here’s my code:

VFXEvent.OnClientEvent:Connect(function(vfxPart : BasePart, positionFinal : Vector3, duration : number)
	if vfxPart and positionFinal and duration then
		local part = vfxPart:Clone()
		part.Anchored = true
		part.Position = positionFinal
		part.Transparency = 1
		part.Parent = workspace
		
		for i,v : ParticleEmitter in pairs(vfxPart:GetDescendants()) do
			if v:IsA("ParticleEmitter") and v:GetAttribute("EmitCount") then
				v:Emit(v:GetAttribute("EmitCount"))
				print("Made it")
			end
		end
		
		task.delay(duration, function()
			part:Destroy()
		end)
	end
end)
1 Like

Verify your remote is being fired. Also any output, warnings, errors?

1 Like

I have verified through a print. The “Made it” print fires 6 times (6 particle emitters). Everything goes through perfectly fine and no errors or warnings

1 Like

A common problem I see people have with particle emitters is that they are firing it too early. Try adding a task.wait([some time]) right before you fire or emit it.

1 Like

check that v:GetAttribute(“EmitCount”) is truthy, check that particles are in the correct position, also check that the part doesnt get destroyed right after particles are emitted

1 Like

Thanks for both you and @MinecoIII2 's reply, I tried both of your solutions, even delaying it a bit and checking that EmitCount is a true value, and the part stays 1.5 seconds which is enough time for it to emit the particles. How can I check that the particles are in the correct position? The attachment I have it in is already in the part’s center, so I was wondering how that would be an issue?

Edit: In addition to this, I even copied the part and pasted it, and then tested emitting the particles via a plugin. It emits directly on the part

If the attachment doesnt move at all it should be fine then, you can check the particles position by just enabling the emitters

Yup, just tested, it’s in the correct position, but still doesn’t emit

Okay, try this: instead of v:GetAttribute(“EmitCount”), replace that by a hardcoded number such as 5

I actually did try right before you said that lol, insane timing but it still doesn’t emit which is strange

Double check that your particles are Enabled

They’re not enabled because I’m using :Emit()

Okay then the if statement is whats wrong, remove the v:GetAttribute(“EmitCount”) frmo the if statement and try again

Just tried this. I also tried rearranging the code into this, but it still doesn’t work. The print statements are going through, but it’s just not emitting.

VFXEvent.OnClientEvent:Connect(function(vfxPart : BasePart, positionFinal : Vector3, duration : number)
	if vfxPart and positionFinal and duration then
		local part = vfxPart:Clone()
		part.Anchored = true
		part.Position = positionFinal
		part.Transparency = 1
		part.Parent = workspace
		
		for i,v : ParticleEmitter in pairs(vfxPart:GetDescendants()) do
			if v:IsA("ParticleEmitter") then
				if v:GetAttribute("EmitCount") then
--					print(v:GetAttribute("EmitCount"))
					task.wait()
					v:Emit(10)
					print("Made it")
				end
				
			end
		end
		
		task.delay(duration, function()
			part:Destroy()
		end)
	else
		warn("Argument(s) missing!")
	end
end)

You’re not iterating through the cloned part Children that’s why

2 Likes

I can’t believe I didn’t realize that, thank you and @MinecoIII2 so much!

1 Like