I wish to make a ParticleEmitter effect, however I want the fire particle to size to what the part would be to cover it. The reason I don’t do this manually is because it’s part of a magic thing with hit detection.
Here is what I mean:
With no size editing:
With a bigger size:
If you guys have any ideas, it’d be much appreciated.
I’m not exactly sure if this would be an optimal solution, but what if you just get the magnitude of the part’s size and set that as the size of the particle emitter? I’m just throwing an idea out there.
Problem is it gives the length of a Vector3, so if a trunk is really tall, it will still come up high regardless of division of any number. The trees alone magnitude is estimated to be 230.
You could do some math & loops to make attachments/parts covering the inside of the part, with particle emitters in them. Not sure how performant it would be, but it’s the best way I can think of.
local part = -- the part
local halfSize = part.Size/2
for x = -halfSize.X, halfSize.x, .1 do
for y = -halfSize.Y, halfSize.Y, .1 do
for z = -halfSize.Z, halfSize.Z, .1 do
local attach = Instance.new("Attachment")
attach.Position = Vector3.new(x, y, z)
attach.Parent = part
local particle = Particle:Clone()
particle.Parent = attach
-- Do whatever else here, like particle:Emit(20)
end
end
end
As for actually sizing them I’m not sure either. Hence why I thought of just spreading particles around instead.
I wouldn’t think this would be optimal in a sense if this is going on in multiple parts at once, it’s bound to cause some sort of performance issues, no?