I’m making my own particle emitter, and I’m having a little trouble making it’s velocity consistent throughout different fps.
RunService.PostSimulation:Connect(function(deltaTime)
if self.rate > 0 then
if latest == nil or os.clock() - latest >= 1 / self.rate then
self:createParticle()
latest = os.clock()
end
end
for index, particle in ipairs(self.particles) do
if particle.velocity == nil then
particle.velocity = particle.direction * (particle.speed * deltaTime)
end
if os.clock() - particle.birthday >= particle.lifetime then
particle.body:Destroy()
table.remove(self.particles, index)
return
end
particle.velocity += self.acceleration * deltaTime^2
particle.body.WorldPosition += particle.velocity
end
end)
I hope the video can give you a clear indication of what I don’t what happening.
Ah, thank you! I actually was confused a bit on this because in school I got taught something along the lines of what I wrote in my code. This blog was very informational; I learned a lot! I’ll change my code relative to this new information