I have been working on Roblox VFX for a few months now, and I would like to know how I can create solid particles (Particles made of parts), if possible, could someone make a simple script for it?
The script would probably look something like such:
local emitFrom = script.Parent
local debris = game:GetService("Debris")
local ratePerSec = 2/60 -- Amount of particles per second
local lifeTime = 10 -- Life expectancy
local running = true
local data = { -- Data for the particles, i.e size, colour, etc
size = Vector3.new(3,3,3),
color = Color3.FromRGB(123, 123, 123),
velocity = Vector3.new(0,50,5),
}
while running do
local part = Instance.new("Part")
part.Size = data["size"]
part.Position = emitFrom.Position
part.Color = data["color"]
part.Anchored = false
part.CanCollide = false
part.Parent = workspace
-- Here I'm going to use BodyVelocity but it's bad practice so I'd
-- Recommend swapping it to something like vectorForce
local bv = Instance.new("BodyVelocity")
bv.Parent = part
bv.Velocity = data["velocity"]
debris:AddItem(part, lifeTime)
end
Do keep in mind the parts wont spread and will all be created at the same place and wont rotate, however this can be adjusted with some simple randomness and maths.
1 Like