Calculating to serverside with Body Velocity causes a brief pause before it starts moving on Client Side

I want to make a part with a Body Velocity which is calculated on the server side.

When I use Part:SetNetworkOwner(nil) it makes the part paused for a brief moment and then start moving. The client side of the projectile/part is off from the server side. How do I fix this?
I had looked for solutions on the Dev Forum however all i found were just the same thing. It was just talking about part:SetNetworkOwner(nil).

This is what I have done.

local part = Instance.new("Part", workspace)
part:SetNetworkOwner(nil)
local bv = Instance.new("BodyVelocity", part)
bv.Velocity = script.Parent.Parent.HumanoidRootPart.CFrame.LookVector * speed
bv.MaxForce = Vector3.new(10000000,10000000,10000000)
bv.P = 1250000
part.Size = size
part.Material = Enum.Material.Neon
part.Color = Color3.fromRGB(255,255,255)
part.CFrame = script.Parent.Parent.HumanoidRootPart.CFrame
part.CanCollide = false
part.CastShadow = false
part.Massless = true
1 Like

This is due to latency. There’s not really much you can do to fix this as nothing can be perfectly in time with the server on the client’s end.

But it’s REALLY, REALLY DELAYED. like EXTREMELY DELAYED.

Unless you visually simulate the projectile on all clients (instead of relying on the servers simulation replicating to users), it will always look extremely laggy, especially when the server is lagging or you have a poor connection. Also, hit detection may be inaccurate for viewers of the projectile because of this. If you take a look at games like Phantom Forces, when you lose connection to the server, you can still play the game locally and you can see yourself firing bullets. This is because that is all handled client-side and what people see are what the server tells them to after you click.

1 Like