Will this cause lag on the server?

  1. What do you want to achieve? Keep it simple and clear!

So basically. I got a cape system that runs on the client. But i also want to make it so the cape physics also update on the server.

  1. What is the issue? Include screenshots / videos if possible!

My idea was to just send over the capes CFrame data once the player moves with remote events. My only issue is that im afraid this will cause lag spikes when theres around 10-20 people playing and sending over CFrame data packed into a table.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Ive done some research on remotes. I found a post that said remote events had a limit of 50 KB/sec. Is this still the case? and will this cause lag spikes?

If you need the codes. Here they are:

Client:

game["Run Service"].RenderStepped:Connect(function()
	
	local Vel = math.clamp(math.abs(Root.AssemblyLinearVelocity.Magnitude),0,150)


	if Vel > 0 then
		Cape:PivotTo(Root.CFrame * CFrame.new(0,-.5,.5) * CFrame.Angles(math.rad(-Vel),0,0))
		Remote:FireServer(table.pack(Cape:GetPivot():GetComponents()))
	else
		Cape:PivotTo(Root.CFrame * CFrame.new(0,-.5,.5) * CFrame.Angles(0,0,0))
	end
	
end)

Server(Test run so looks ugly):

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Plr,CFData)
	local Cape = Plr.Character.Cape
	
	Cape:PivotTo(CFrame.new(table.unpack(CFData)))
end)




1 Like

You should also use a networking module like BridgeNet for better performance:

1 Like

This wont be the best optimization, no matter what networking module you may use. Don’t get me wrong - Bridgenet is a gift from god - but lets dissect this here.

Each player will be sending this 60 times a second.

:sweat_smile:

1 Like

Yeah that basically answers my question pretty well i guess xd. Ill mark this as solved

btw about the cape, is this some sort of MODEL? or some acessory [cape]

you know, in blender you can rig it and animate (adding some bones) not really that hard, i saw some tutorials

doing that stuff is really expensive, maths are expensive depending on what stuff ur doing

but if you wish to animate something constantly just use some animation, and make it loop, if some ‘‘Event’’ is happening, then change the animation according to it, it will cost less, and you will be able to animate and show to everyone around
( since animations replicate from the client , that’s what i heard)

1 Like

Yeah i just went with updating the cape on the client instead and not server