Hello! I am stuck on the problem about how each client would reposition all other players in a certain way
In the game I am working on, the terrain of the game moves around independently of the server on each client. Each client is then freely allowed to move on their terrain that their client has moved. This causes an issue where other players’ characters are desynced with where they would actually be expected to be in a given client.
This happens because when the player moves on a client, it tells the server the player’s exact position, instead of the position relative to the terrain
Diagram incase my explanation didn’t explain it well. The + being a reference point with equal position on each client, and the circles being individual players/clients
Intended:
reality:
I’m struggling with how I would get the intended effect, where each player appears on each client realtive to where that client is actually relatiuve to that client’s terrain, like shown in the diagram above (again, so sorry for being bad at explaining
)
For reference, this is how my terrain moves. On jump, the terrain rotates 180 degress around the player’s forward direction:
I don’t think the way the terrain movement works is necessary, so I won’t show the code for it, unless asked.
Here is also how the bug looks like. The other player shown is flipping terrain and not being in the intended position
Solution
So far, I have only figured out where to postion the player on each given client, but I am struggling with how I would actually position the character of each player, as the server will override any character position change.
-- part of the terrain. Used to keep track the cframe of the island
local referencePart : Part = workspace.Reference
-- client tells the server that the player has moved and where
local onMoveEvent : RemoteEvent = game.ReplicatedStorage.OnMove
-- server tells each client where a player should be
local movePlayerEvent : RemoteEvent = game.Replicated.MovePlayer
--======= CLIENT #1
local refCFrame = referencePart.CFrame
local plrCFrame = hmpr.CFrame
-- player position as it would be on the server
local plrCFrameOnServer = plrCFrame:ToWorldSpace(refCFrame)
onMoveEvent:FireServer(plrCFrameOnServer)
--======= SERVER
onMoveEvent.OnServerEvent:Connect(function(plr, plrCFrame)
movePlayerEvent:FireAllClients(plr, plrCFrame)
end)
--======= CLIENT #2
movePlayerEvent.OnClientEvent:Connect(function(plrToMove, plrCFrame)
-- the position this player should be on this client
local CFrameOnClient = plrCFrame:ToObjectSpace(reference.CFrame)
-- what now?
-- btw, am I using the ToObjectSpace and ToWorldSpace funcs correctly?
end)
If there are any other alternatives methods I should try, please do tell. Any help appreciated. Thanks yall!

