I was wondering what method you recommend me to Replicated arms movement,
This are weapons, I use C0 of the Right Shoulder and Left Shoulder
But when I try to replicate, (firing a remote event and changing Torso > Left Shoulder and torso > right shoulder) C0, something weird happens, and it starts to glitch for the client.
What method do you recommend me for replication to server?
My favourite method is this:
Sorry about the necropost, but you could CFrame it via RenderStepped on your client, and you can fire the server which would fire everyone else’s client to tween it. It would be smoother for you, and for them.
local tiltEvent = ...
tiltEvent.OnServerEvent:Connect(function(tiltPlayer, joints, cframes)
for _, player in ipairs(Players:GetPlayers()) do
if player ~= tiltPlayer then
tiltEvent:FireClient(player, joints, cframes)
-- their clie…
You would simply just replicate a table consisting of the C0 itself and the motor object.
But, Firing a Remote Event every single 0.1 secs wouldn’t cause a bit of lag?
No, you do it ever 0.1 seconds which wouldn’t. I don’t know how to explain why it doesn’t lag, but I’ve done this many times before and it doesn’t.
Your ping would be affected by how much data (as in size) you send in a rapid succession, not how often.
So, should I fire on
EVERY client the tilt event?
Every client except your own. The reason why the tweening method is buggy is because your also moving your joint at the same time.
Ok so, what do you think about this?
game.ReplicatedStorage.WeaponSystem.Events.ReplicateArms.OnServerEvent:Connect(function(Player,RightShoulder, NewRightC0, LeftShoulder, NewLeftC0)
for i,v in ipairs(game.Players:GetPlayers()) do
if Player:DistanceFromCharacter(v.Character.Head.Position) <= 100 and v ~= Player then
game.ReplicatedStorage.WeaponSystem.Events.ReplicateArms:FireClient(v, RightShoulder,NewRightC0, LeftShoulder, NewLeftC0)
That should be fine. I’d recommend using my code and modifying it slightly.
Alrighty, Last question, what would be Memory leaks? and how to prevent,
If you know any post that could help me
By disconnecting from connections that are created frequently. You don’t need to disconnect from PlayerAdded, but you may need to disconnect from CharacterAdded or Died.