From 75600d54f964e78d10a6c866808608860c64e00f Mon Sep 17 00:00:00 2001 From: Zemtzov7 <72821250+zmv7@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:08:21 +0500 Subject: [PATCH] fix particle randomization --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index ace34d9..f96a85d 100644 --- a/init.lua +++ b/init.lua @@ -107,11 +107,10 @@ end rocket.on_step = function(self, dtime, moveresult) self.timer = self.timer + dtime local pos = self.object:get_pos() - local rnd = math.random() core.after(0.1,function() core.add_particle({ pos = pos, - velocity = {x=rnd,y=rnd,z=rnd}, + velocity = {x=math.random(-0.5,0.5),y=math.random(-0.5,0.5),z=math.random(-0.5,0.5)}, expirationtime = 0.1, size = 6, collisiondetection = false, @@ -120,7 +119,7 @@ rocket.on_step = function(self, dtime, moveresult) glow = 15}) core.add_particle({ pos = pos, - velocity = {x=rnd,y=rnd,z=rnd}, + velocity = {x=math.random(-1,1),y=math.random(-1,1),z=math.random(-1,1)}, expirationtime = 0.7, size = 6, collisiondetection = false,