SetNetworkOwner not working as described?
Asked by
7 years ago Edited 7 years ago
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
01 | function spell:Fire(player, mousePosition) |
02 | local projectile = part:Clone() |
03 | local start_position = player.Character:FindFirstChild( "Wand" ).Handle.Tip.WorldPosition |
04 | local angle = (mousePosition - start_position).unit |
06 | projectile.Position = start_position |
07 | projectile.BodyForce.Force = Vector 3. new( 0 , 180 , 0 ) * projectile:GetMass() |
08 | projectile.Velocity = angle * 150 |
09 | projectile.Origin.Value = player |
10 | projectile.Parent = workspace |
12 | projectile:SetNetworkOwner( nil ) |
13 | spell_fired:FireAllClients(projectile) |
15 | projectile.Touched:Connect( function (part) |
16 | self:Hit(projectile, part) |
19 | delay(self.Lifetime, function () |
20 | self:Fizzle(projectile) |
I also have a client-side script that handles visual effects if that makes any difference.