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.

local HandleCFrame = Handle.CFrame
local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset)
local ShotCFrame = CFrame.new(FiringPoint, target)

local LaserShotClone = BaseShot:Clone()
LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2))
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.velocity = ShotCFrame.lookVector * Speed
BodyVelocity.Parent = LaserShotClone
LaserShotClone.Touched:connect(function(Hit)
	if not Hit or not Hit.Parent then
		return
	end
	Touched(LaserShotClone, Hit)
end)
Debris:AddItem(LaserShotClone, Duration.Value)
LaserShotClone.Parent = workspace
LaserShotClone:SetNetworkOwner(nil)

Thanks

2 comments

0

what exactly do you mean by lagging?

0

right after it fires, the bullet just stays there mid-air for like half a second then continues moving