I am creating some client-sided bullets as AA bullet from ships and machine guns from planes.
I set the network owner to a random player when a bullet is shot, as ships are controlled by A.I. For some reason, the bullets fly normally for a split seconds and than simply freeze. Even weirder, in my laser tag game, it works like normal as expected.
Here is my shooting code:
local gunManager = {}
local aa = game.ReplicatedStorage.Projectiles.AAShell
function gunManager.AAShot(ship, gun, orientation)
local player = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
gun.Barrel.ShootAtt.Flash:Emit(25)
gun.Barrel.ShootAtt.Sparks:Emit(25)
local shot = aa:Clone()
shot.Position = gun.Barrel.ShootAtt.WorldPosition
shot.Orientation = Vector3.new(math.random(orientation.x-3,orientation.x+3),math.random(orientation.y-3,orientation.y+3),math.random(orientation.z-3,orientation.z+3))
shot.Color = workspace.Colors:FindFirstChild(ship.Data.Team.Value).Color
shot:FindFirstChild(ship.Data.Team.Value).Enabled = false
shot.Team.Value = ship.Data.Team.Value
shot.Parent = workspace
shot:SetNetworkOwner(player)
delay(1.35, function()
shot:Destroy()
end)
end
return gunManager
Here is my bullet code.
script.Parent.BodyVelocity.Velocity = script.Parent.CFrame.LookVector * 3000
It works for a split second then completely freezes.
To make it work like normal, I need to anchor and than unanchor the bullet.
Please help, I’m very confused.