I’m currently working on a volleyball game, and I use a Client-Server-Client system to render a ball in the same spot on every client to prevent lag. However, after some extensive testing it seems that most of the time the clients are rendering completely different balls. I use bodyvelocity and bodyforce currently to move the balls. Does anyone have any suggestions/help? I am trying to get all clients to render the exact same ball no matter what.
Code example:
--server script
keypressed.OnServerEvent:Connect(function(plr)
spike:FireAllClients(function(plr)
end
--local script
spike.OnClientEvent:Connect(function(plr)
local character = plr.Character
local hitbox = repstorage.Hitbox:Clone()
hitbox.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0,1.5,1)
hitbox.Touched:Connect(function(part)
velocity.Parent = part
velocity.Velocity = Vector3.new(10 * character.HumanoidRootPart.CFrame.LookVector.X, 20, 10 * character.HumanoidRootPart.CFrame.LookVector.Z)
wait(0.2)
velocity:Destroy()
end)
end