How to combat lag that comes from tweening?

Ok, so I have a procedural animation system I’m working on, and it is generating a fare amount of lag. Currently all the tweens for the animations are handled on the server, yes I know that is a terrible method of doing things. I plan on handling the animations on the client. My question is, how do I do animations on the client? My game is supposed to be a fast FPS game, similar to phantom forces or arsenal. I do not want my animations to have lag, nor do I want the players positions to have latency. Here are the solutions I have come up with so far.

solution 1: make all of the players just have torsos and heads. Torsos/heads will replicate to other clients and servers, clients will be in charge of placing the arms/legs correctly.

solution 2: have the server make all the calculations, just not run the tweens. Server will pass calculations to clients, clients will update other players accordingly.

Which one of these would cause the least lag? Is their some other solution I have not thought of? Thanks in advance!

This resource might be the thing you are looking for:

TweenService V2 is a module that helps with efficiently replicating tweens between the server and client. It allows for the server to run the tweens as though you are running them on the server, however, the tweens only run clientside. This reduces serverside lag as it’s not tweening the object itself, or continuously replicating the property to the client. Although the tweens only run clientside, the end result of the tween will be reflected server side once the tween has finished.

Quote from the dev forums page.

TweenService V2 DevForums Link
TweenService V2 Youtube Showcase by the developer

1 Like

This is useful, from a quick glance it looks as though it makes client sided tweens replicate server sided. If I tweened all of the characters movements on the characters client would that character replicate to other characters? I really don’t care if it replicates server side, just that all the clients can see it. Also, from my understanding the tween starts on the client, gets passed to the server, and then must be sent to all other clients. Will this cause significant delay?

I have personally never tried this module. However from what I understand it starts the tween on all the clients at the same time then when the tween is finished it teleports the object on the server-side. So I believe it should replicate through all the players and there should be no delay.

1 Like