How to optimize Particle Emitter?

Hi everyone, I’m creating an in-game event where players launch a rocket by spamming keyboard keys. Each key press triggers a particle emission. Is this an efficient approach?

Here’s a simplified script

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(Input, GameProcessed)
	
	if GameProcessed then
		return
	end
	
	script.Parent:Emit(1) -- Parent is the ParticleEmitter
end)
1 Like

You should add settings for it to disable particles, also add Visual Debounce

If you don’t know there are 2 types of checks: Visual ones are on client and prevent normal players from breaking their visuals, also they can reduce bandwidth sometimes, for instance debounce on both client and server can bypass normal player from spamming remotes, soo it would be a lot harder to lag the whole server with autoclicker

This is only on the client and should emit 1 particle when a key is pressed.

Then visual check will do, add some small debounce like 0.05 or 0.1 of a second, you can also add settings for disabling particles as i said

It won’t cause much lag.

Assuming there could be around 40 key presses a second, it won’t cause extreme performance issues.

1 Like