Making players position undetectable for clients while maintaining detectable for other clients

The title is a little bit difficult to explain, but here’s how it’s going;

To make clients unable to find players position, I make their characters anchored on server, which they can’t move obviously, so I make their characters unanchored on client, and now they’re able to move around freely, the problem is that, ONLY their character is seen moving, for their client, other players seem frozen.

What I need is that I want to make a group of players be able to see each other’s character movement, while others can’t.

Let’s say I have A, B and C player in the server, A and B can see each other’s movement, while C can’t see theirs.

I tried unanchoring other players’ character on the client, but that only makes it worse as their animations work but not moving.
I find my best here is that I could fire a position to server, then the server decides who should be able to see their position, I have that as my idea but I thought it looks “unappealing” and not natural.

I’d love to hear your idea of how to make this work, thank you.

Making players character invisible is a good option, but it’s also vulnerable to exploiters, which I’m trying to use some trick here.

do you mean undetectable as in no possible way for even a hacked client to see it, or undetectable as just invisible

The method you want to use will not work. Client to client communication goes from Client → Server → Other Clients. The server state will be combined and override any state of the client which it already has. In this case, unanchored players on the client will be overridden by the anchored setting on players, which then gets sent to other clients.

How I would tackle this issue is to make a ServerScript (which also combats exploiters) with the by you mentioned method of classifying the players into three different teams, give them a custom boolean which makes the other teams turn invisible or freeze, and whenever the round starts or something triggers, you fire the server to run the command. That way, it will guaranteed be the same for all clients.