The code is in a script

function activeCannon()
	local cloneProject = Instance.new("Part")						
	cloneProject.Name = "OutputProject"
	cloneProject.Size = Vector3.new(1.25,1.25,1.25)
	cloneProject.Shape = "Ball"
	cloneProject.BrickColor = BrickColor.Black()
	--Shooter is where the projectile will spawn
	cloneProject.CFrame = script.Parent.Shooter.CFrame
	cloneProject.Parent = workspace
	cloneProject.Velocity = script.Parent.Shooter.CFrame.LookVector * 677
end

activeCannon()

When the projectile (cloneProject) is created, it first seem like it is anchored in the air for a moment (which means latency) and it resumes accelerating at its given velocity.

I tried to move the cloneProject.Velocity at the very first line in activeCannon() but I get the same issue.

How do I fix the latency issue?

Thanks

10 comments

0

FYI: This is not a script in the tool. Its basically an automated cannon

0

Seems like the network owner of the object changed

0

But the network owner is nil

0

The network owner will be the client that's nearby the projectile, and when it'll move too far from the player, the network owner will change to nil, thus causing a "hop"

0

When I checked the server side, there wasn't a lot of latency. But on the client, there is. I also checked the network owner of the projectile and it is still nil, even before the velocity is set.

0

So I think it has something to do with the client side?

0

Maybe, one thing I recommend is to set the velocity before setting the parent. Always set the parent last no matter what you are doing.

0

Because it causes lag to change the properties of a part and then replicate those to the clients in the server, it is generally best to set the parent property last.

0

That is why the second parameter of Instance.new() is deprecated.

0

Nope. Doesn't work. Has something to do with the client