How to fix bullet lagging for less than a second right after it gets fired?
All of my guns in a game, have a script similar to this but with different bullets, and all of them are lagging for half a second right after they're fired. Some bullets are also rotating. I tried setting network owner to nil as other people said, but there was no difference. Also tested in a local server.
01 | local HandleCFrame = Handle.CFrame |
02 | local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset) |
03 | local ShotCFrame = CFrame.new(FiringPoint, target) |
05 | local LaserShotClone = BaseShot:Clone() |
06 | LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2 )) |
07 | local BodyVelocity = Instance.new( "BodyVelocity" ) |
08 | BodyVelocity.velocity = ShotCFrame.lookVector * Speed |
09 | BodyVelocity.Parent = LaserShotClone |
10 | LaserShotClone.Touched:connect( function (Hit) |
11 | if not Hit or not Hit.Parent then |
14 | Touched(LaserShotClone, Hit) |
16 | Debris:AddItem(LaserShotClone, Duration.Value) |
17 | LaserShotClone.Parent = workspace |
18 | LaserShotClone:SetNetworkOwner( nil ) |
Thanks