On the server I’m tweening 72 Vector3Values to a different value at the same time. But it uses over 100 kb/s for this alone. Is there a more optimized way to slowly change the value of a vector3 to a different vector3?
Never use the server to do anything visual. Ideally, the server should only deal with client-server communication and secure data. Instead, use remotes to tell clients when to use certain animations/tweens or what to update to.
Tweening is still not a great option. You could use a loop to update it as the position event no longer works, but this can still be intensive. Also, you should be using Attributes instead of values. They’re faster and load instantly (no need to use WaitForChild).
local st = os.clock()
for i = 1,50000 do
local se = workspace.StreamingEnabled
end
local en = os.clock()
print((en-st)*1000)
local st = os.clock()
for i = 1,50000 do
local se = workspace:GetAttribute('StreamingEnabled')
end
local en = os.clock()
print((en-st)*1000)
Test it out for yourself
Also I’m still looking for a better option than tweening all these Positions to their Destination because it uses up too much bandwidth
I’m using custom NPCs that arent humanoids, and Humanoid:MoveTo() is too performance heavy for my end goals, (400 NPC’s moving around with little to no lag)
The only other option I can think of off the top of my head is to only update goals then. Have a delay for how long you expect it to take to reach the goal, then change the goal after that. Each time the goal is updated, the client can take over on its end. You can also store the time at which the goal started in order to update clients that join or update late.