Making a little beam attack and as you can see on the right works perfectly fine and moves smoothly but on the left for the victim its delayed. Im using networkownership and setting to player seems to only make it look nice and smooth for the user. Setting to nil just keeps a delay velocity look for both of us as well as touch delay. So whats the best alternative method to avoid this issue???
local Char = Player.Character
local HumRT = Char:FindFirstChild("HumanoidRootPart")
local beenhit = {}
local ball = repstore:FindFirstChild("Ball"):Clone()
ball.Parent = workspace
ball.CFrame = HumRT.CFrame
--* CFrame.new(math.random(-3,3),math.random(-3,3),0)
ball:SetNetworkOwner(Player)
local vel = Instance.new("BodyVelocity",ball)
vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
vel.Velocity = HumRT.CFrame.LookVector * 200
game.Debris:AddItem(ball,5)
ball.Touched:Connect(function(hit)
if hit:IsA("BasePart") or hit:IsA("MeshPart") then
if not beenhit[hit.Parent] and hit.Parent.Name ~= Char.Name and not hit:IsDescendantOf(Char) and not hit:IsDescendantOf(ball) and hit.Parent:FindFirstChild("Humanoid") then
beenhit[hit.Parent] = true
spawn(function()
wait(1)
beenhit[hit.Parent] = false
end)
ball:Destroy()
hit.Parent.Humanoid:TakeDamage(10)
game.ReplicatedStorage.Barrage:FireAllClients(hit)
end
end
end)