I am trying to create a game that uses projectiles. I'm using SetNetworkOwner(nil) to try and remove the "hops" described on the network ownership page. However, even when I am using SetNetworkOwner(nil), the "hops" still happen. What gives?
Code
function spell:Fire(player, mousePosition) local projectile = part:Clone() local start_position = player.Character:FindFirstChild("Wand").Handle.Tip.WorldPosition local angle = (mousePosition - start_position).unit projectile.Position = start_position projectile.BodyForce.Force = Vector3.new(0, 180, 0) * projectile:GetMass() projectile.Velocity = angle * 150 projectile.Origin.Value = player -- originator player, userdata projectile.Parent = workspace projectile:SetNetworkOwner(nil) spell_fired:FireAllClients(projectile) projectile.Touched:Connect(function(part) self:Hit(projectile, part) end) delay(self.Lifetime, function() self:Fizzle(projectile) end) end
I also have a client-side script that handles visual effects if that makes any difference.