I want to make it so instead of waiting a split second to emit the particles, make it so it fires all of them at once
ignore the “emitted == false”, i tried it to do it without a task.wait() and didnt work
From what I understand you want to make all of the particles emit once the loop goes thru all of them. It’s an easy solution.
You could just make a variable and then add to it each child found, once it reaches the total amount of children you could then emmit each particle.
local found = 0
for i,child in finalHit:GetDescendants() do
if child:IsA("ParticleEmitter") then
found +=1
end
if found == i then
child:Emmit()
end
end
There’s generally no way to emit particles all at the same time, but you could optimise it
local Particles:{ParticleEmitter} = {}
for _,child in finalHit:GetDescendants() do
if child:IsA("ParticleEmitter") then
local emitCount = tonumber(child:GetAttribute("EmitCount"))
Particles[child] = emitCount
end
end
for particle:ParticleEmitter, emitCount:number in Particles do
particle:Emit(emitCount)
end
(EDIT: the other guy’s solution was incorrect, the index
would never match the quantity of particles defined as a found
variable, and he misspelled “Emit” with “Emmit”)
xd sorry i knew something was wrong but i never gave it thought
although it still doesnt work, maybe theres something wrong with my setup ill send more ss
The third screenshot is the important one but i sent more just in case
does your animation happen to even have the marker called “End”?
yes it does and i also made sure to spell them correctly by copying the events directly from the animation
you’ve been quite broad with the issue, not sure what do you mean by “it doesn’t work”, can you send us the output logs?
(this is how you can enable it incase you don’t know)
output is just a waitforchild it doesnt have to do with the topic really
I agree. index
would never be the same as found
as there could be other instances alongside particles, which is why I suggest on storing the particles separately in a folder and then looping through that instead, so index
would match found
. Maybe fix my mispelled :Emit()
aswell.
I’d like to point out SolidTurret’s solution would only introduce more latency to your loop as he makes a separate array with the particles and then loops through that array again.
Please make sure your Infinite Yield dissapears aswell.
finalHit isnt a folder, its a part but i guess it would be the same since i want to access it from an Instance but i tried fixing your misspell and the particles just didnt show up
Have you tried making a print
preferably print(HumanoidRootPart)
inside the loop to see if it works at all, and if your infinite yield is gone? Maybe reduce the time from your Debris:AddItem
aswell?
I’ve tried doing the print() and it doesnt even work at all, the only setup that seems to work is the original one, also i doubt that reducing the Debris:AddItem time will help but ill try anyways
That’s really odd, and as SolidTurret mentioned your information is pretty undetailed. Could you provide a video with your original method?
ill try to but my recording software is pretty buggy
video was too big for robloxs web to handle
also i know about the animation, its from the toolbox and i intend to change it
have you considered that the Hitbox part might not be triggering its event because you connected a .Touched event after you’ve parented it to workspace? (not sure when the Dash marker triggers)
that marker has basically 2 triggers, the “EVENT” and the “Dash” trigger,
so, the event makes it so the player cant move or jump while doing the move,
and the “Das” event manages all of the hitbox and vfx stuff that ill add later