Is remote events constantly firing bad?

I have a gun script that also handles gun animations, and the problem is that these animations only show up client side since it is a local script. So I have remote events that tells the server what the character’s current state so far. No problem with that, but 2 of the remote events. The two that handle Idle/running/walking animations and moving the head so it looks up where the mouse cursor is pointing. These two remote events are in forever loops, so they fire over and over and over again. I wonder how bad of an issue this would be since each player will be firing their own constant stream to the server. Will this be a problem for performance or not?

Rep.Lookyupydowny.OnServerEvent:Connect(function(Player,MDir,HeadRot,Neck,HRP,Humanoid,Torso)
	local HRPCF = HRP.CFrame * CF(0, 1.5, 0) * CF(Humanoid.CameraOffset)
	Neck.C0 = Torso.CFrame:toObjectSpace(HRPCF)
	HeadRot = -math.asin(MDir.y)
	Neck.C1 = CFANG(HeadRot,0,0)
	print("a")
end)
Rep.Runningswayer.OnServerEvent:Connect(function(Player,AnimweldC0,AnimWeld)
	AnimWeld.C0 = AnimweldC0
	print("b")
end)

type or paste code here

I also have a shotgun that fires ~20 shots which, If hit something immediately causes a noticeable (on micro profiler) pause. This pause is caused simply by the main gun script firing a remote event to make all the bullets, then firing a remote event that fires to all clients to make the bullet holes and damage what is needed. But it was notable to mention it here.

I also have a playground where you can mess around with the guns Muffin Maker - Roblox.

While PLS DONATE has torso movement replication, meaning each client fires a remote 20 times a second, it also has a server cap of 28.

I believe it’s not that bad to fire remotes in that way, but here’s the thing.
If you fire a remote for 20 bullets all in one frame, and for instance, you do it each frame constantly, the remote might get throttled.

While not having much experience with FPS or gun systems, but judging from common sense and logic, I believe the best thing you can do is fire a remote with a speed of 20HZ (aka 20 times a second) Why 20HZ? Because it’s the same as the speed of Roblox replication.

You would have to create a remote replication system, where you pass a table with all the data needed with the speed of 20HZ to the server and from server to the client.

If you for an example shoot around 100 bullets a second, you wouldn’t fire the remote 100 times, you would fire it 20 times, with a table that contains information of 5 bullets per time.

Here’s the post about Roblox replication speeds:

1 Like