How would I create particle engine like this?

Hey! I’m Daniel and I was wondering, how would I create a particle engine like this:
https://roblox.com/games/4595863515/Portal…
For example, once you press a ball or a wedge, Sparks pop up and bounce on the ground.

I’ve tried things like a particle grid or cframing particle bricks.

They all failed due to the unrealistic or laggy look.

If anyone could give me a tip or help me further into this, thank you.

Also side note, I’ve posted this on Art Design Support as I’m not sure if it’s about a script or about SFX.

5 Likes

My guess is that when it hits that it spawns a bunch of small spheres on the client with a random velocity being added that pushes them outward. That way it is just the physics system handling it.

I’ve updated it to handle replication and prevent player collisions.

1 Like

My guess is that it uses invisible spheres with billboardguis as the visible particle, and then disabled collision with the player using collectionservice.

1 Like

Hey, could you make it so it’s not a particle you have to enable trough button? I’m on mobile right now as I’m sick so I can’t see. Sorry for the inconvenience.

1 Like

Hm this seems interesting, but I’m not the best at scripting, so how would I make it so this plays infinitely or just for a few secs without having to press a button? Maybe one with a button and one without?
This is a solution btw, thanks.

Side note on this, yes I’m DeRobloxMeneer btw, but because of it being can collide the player will have a strange climbing animation mid air.

You can use NoCollisionConstraint or use PhysicsService

1 Like

Hm, that could work yes but how would I make it so all the balls would have that with the humanoid it’s bodyparts?

I’ve also gotten an idea with the system from tlr22, I make the balls invisible and add tiny particle emitters to them with a spark icon.

So this can be called as a function in the script. In that little demo I didn’t bother with replication to other clients or collision groups to make it not collide with the player.

1 Like

You could use collision groups. Place them in one that only collides with the world, not players.

1 Like

Give me a moment to modify it a bit

1 Like
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local spawnPoint = game.Workspace:WaitForChild("Base")
local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)

local particles = function()
	for i = 1, 30 do
		local b = script.Part:Clone()
		for _, v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
			if v:IsA("BasePart") then
				local n = Instance.new("NoCollisionConstraint")
				n.Parent = b
				n.Part0 = b
				n.Part1 = v
			end
		end
		local spawnLoc = Vector3.new(math.random(-100, 100) / 100,math.random(-50, 50) / 100,math.random(-100, 100) / 100)
		b.Position = spawnPoint.Position + spawnLoc
		b.Velocity = spawnLoc*math.random(5,40)
		b.Parent = game.Workspace.CurrentCamera
		
		TweenService:Create(b,tweenInfo,{Transparency = 1}):Play()
		game:GetService("Debris"):AddItem(b, 3)
	end
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if not gameProcessed and input.UserInputType == Enum.UserInputType.MouseButton1 then
		particles()
	end
end)
UserInputService.TouchTap:Connect(function(input, gpe)
	if not gpe then
		particles()
	end
end)

However it will cause short lag on client, so I would reccomend using PhysicsService

3 Likes