How can I lower the data that the server sends here?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to be able to send less data to the clients.
  2. What is the issue? Include screenshots / videos if possible!
    The server sends around 7.7kb per enemy, and thats way too much.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried many things, nothing worked. Dev Hub gave nothing.

Here is my current code:

rus.Heartbeat:ConnectParallel(function(dt)
	for i, v in pairs(enemyz) do
		local direction = (v.Target.Value.Position - v:GetAttribute("Pos")).Unit
		local moveAmount = direction * v:GetAttribute("Speed") * dt
		local result = v:GetAttribute("Cf") + moveAmount
		
		if (v:GetAttribute("Pos") - v.Target.Value.Position).Magnitude > .1 then
			task.synchronize()
			v:SetAttribute("Cf",v:GetAttribute("Cf") + moveAmount)
			v:SetAttribute("Pos",(v:GetAttribute("Cf") + moveAmount).Position)
			remote:FireAllClients({v.Name,result})
		else
			task.synchronize()
			v.Target.Value = workspace.TestMap.Track.PathfindingLocations:FindFirstChild(v:GetAttribute("Target") + 1)
		end
	end
end)
1 Like

Found a way after almost killing my brain!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.