Basically the title, I have a head rotating script which I’m updating by firing a remote event every .1 seconds, however this is an issue with individuals with high ping because their camera compared to their head will be delayed. Is there any way to give actual network ownership of the Motor6Ds or simulate network ownership in some way?
I tried tweening on both the client and the server but since the server replicates for the client that fired the remote, it causes stuttering
Example of what someone with 500ms ping would see:
Really, the only thing I can think of is to tween on every client but I’m not sure how performant tweening up to 32 instances (16 neck and waist joints per player) every .1 seconds would be, especially with respect to how much content would be downloaded.
Another thing I’m thinking of is somehow creating a new Motor6D on the client, destroying the old M6D but I’m thinking it would cause joints to break. I really don’t know how to proceed :/
I can provide the script if you need it but it really isn’t anything interesting.
Update: I tried cloning the neck and waist joints and it seems to be getting there, however the character still dies despite having disabled the dead HumanoidStateType, even though the character is able to move and whatnot.
From what I’ve seen of systems like this, they just replicate the direction the camera is looking using remote events then a LocalScript on every client translates that into the Motor6s of all the characters (the players own character doesn’t get updated by a remote event, instead it gets instantly updated with real time info).
There isn’t really a way to get the character to update faster than that instantly for the player’s character and client n > server > player’s client for other characters.
The thing is I’m using tweens to make the head move around smoothly but I fear doing 32 tweens per client is going to not be performant, I want to avoid doing this if I can.
I’d just use the lerp function every frame. Tween could possibly get a little intensive (since the goal needs to change constantly, therefore tweens need to be created constantly). Lerp should be fine though.
You could attempt something like exploiters did for “reanimate” scripts.
Ill elaborate:
Set Humanoid.RequiresNeck to false,
Give Client NetworkOwnership of every part in their body,
Make a client script that adds Attachments with AlignPosition/AlignRotation parts and just go from there.
I think that’s all that it requires, I’m not too sure though.
You can use CFrameValue or Vector3Value, hence their names, you change their value on the server and do the math calculations on the client, before doing this, do calculations before sending camera data (ex: camera direction) to the server, make the server ignore the player who sent the data and send the data to other clients
I could be wrong though…idk
The way you described it, I think TweenService, as you mentioned, would be the best solution.
You could add some optimizations to it, only allowing tween for players within 150 studs of the player, while all others will use instant snapping.
You really shouldn’t encounter issues with tween service as long as you aren’t calling it too often. I would say send players the information of close-by (within 150 studs) neck and waist Motor6D values every .25 seconds.
Implementing this should give you the solution you are looking for. Just make sure you aren’t sending too much information to the client, .25 seconds with TweenService should suffice.
Your largest concern should be network performance, not client rendering and physics performance.
Thanks to everyone who provided input, however I think only doing one change on the client (the local player), and the server would be the best option since I would assume the server is able to handle many more instances and calculations than an individual on a low-end mobile device can- and this is the main reason I chose this answer over the others.
I’m just gonna reply to others with why I haven’t chosen their solution because I do believe all of these solutions do have their uses, however there are also some flaws. Don’t take it as an insult though, just some considerations to be made.
Only issue is that I want to avoid sending as much data to the client as possible. I’m pretty sure the client has to download things from the server in order to replicate everything but having to replicate from the server plus calculate every single interpolation calculation still gives a relatively undesired result.
Seems a bit hacky with, at least in my experience, body mover-esque objects seem to be a bit finicky and can give undesired and/or inconsistent results. Plus I’m not sure how well it would work with Motor6Ds being static and not able to rotate like a HingeConstraint/BallJointConstraint can do.
Issue with this is that if players are all within 150 studs of each other, the client will have to account for all 15 other characters, plus themselves.
I wanted to factor both: the best-looking method while not sacrificing much, if any network performance, and not causing frame drops on the client because their memory spikes.
If there’s something I’m missing or if I got any information wrong, please do tell me, there could be a better option for reasons, however bearing both network performance, physics performance, and visual appearance, I believe the that solution is the best option for my scenario.