#Why do i need the task.wait(0.1) to emit particle

1 messages · Page 1 of 1 (latest)

wide burrow
#

the emit particle works only when before i put a task.wait(0.1), i tried to see if its just the children of the part that contains the particles just, didnt have the time to load without the task.wait, but i can print the childrens and his properties without any problems, even with this, the particle doesnt emits

parryParticleClone.Parent = game.Workspace
local forward = char.HumanoidRootPart.CFrame.LookVector 

            
parryParticleClone.Position = char.HumanoidRootPart.Position + (forward * 2)
soundPart.Parent = game.Workspace --ignore
soundPart.Position = char.HumanoidRootPart.Position --ignore
task.wait(0.1)  --this
particleEmitter.emit(parryParticleClone)  
#

(i delete the line of task.wait), it prints that has been emitted, so it actually found the particles, and for some reason the :Emit just does nothing, no error, no load, nothing, i need to put the task.wait(0.1) to make it work

function module.emit(part)
    
    for _, particle in pairs(part:GetDescendants()) do
        
        if particle:IsA("ParticleEmitter") then
            print("emitted")
            particle:Emit(particle:GetAttribute("EmitCount"))
        end
    end

end
inland reef
#

Why this guy can't type anything

#

here

#

I don't really know but maybe the game does it so fast that it can't even render anything so when you put task.wait() it actually waits and puts particles in it

#

Just my opinion

#

no idea

wide burrow
inland reef
#

slugregime just typed something and got deleted

wide burrow
inland reef
#

I don't know I only see the first problem I said

#

Maybe someone who is more advanced can solve this thing

teal steppe
#

Try using RunService.Heartbeat:Wait() that just waits until the next frame