What do you want to achieve? Keep it simple and clear!
I am trying to anchor a person when they are seen by others.
What is the issue? Include screenshots / videos if possible!
If they get anchored while they are running, their position may show differently than on the server for everyone else probably because of server delay or something.
Here is an example
Client on left- Everyone’s View
Client on right- Frozen player’s view
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
My only solution is, fire an event sending them their server position and setting all their body part positions to the requested positions.
This however isn’t 100% perfect as there’s still a TINY noticeable delay, and it also comes with the annoyance of the client that’s being anchored to be visibly teleported because of this.
-- THIS IS ON SERVER SCRIPT
for i, Part in ipairs(WA:GetChildren()) do
if Part:IsA("BasePart") then
Part.Anchored = true
Unfortunately, there isn’t really a solution to this. You should clone them and anchor the clone instead.
I’m not sure if I understand. Could you elaborate on it? Do you mean to like clone them on the server, then switch their character to that?
To stop this, I think you should anchor them from their client. If you’re going to put ice on them to appear to make them frozen for example, just fire the event to the client to anchor them then task.wait so their movements stopped, then weld the ice to them.
This makes the delay better but is still not perfect unfortunately and it also doesn’t anchor them on the server which isn’t what I want, if you have any other solutions please say.
Okay so here is the best solution I got that I’ll stick with. I decided that when the player gets frozen, an event will be fired to the server to change the server’s position to the client’s position. This is the best solution so far that I have, it’s a bit exploitable because exploiters can use this event to teleport their player but with some sanity checks and security it should be fine.
Do you use a RemoteEvent for it?
Remote event to anchor them on the client? Yes. If you meant to also anchor on server, then this fix does nothing.