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.