Client objects are being controlled by other clients

I’ve been having an issue with my game, where a client object is being controlled by other clients. I cloned an object in ReplicatedStorage with a local script and parented it to the workspace.
for i,v in pairs(game.ReplicatedStorage.ClientObjects:GetChildren()) do local c = v:Clone() c.Parent = c.parent.value end
For some reason though, other players can still interact with it. A video has been posted below to demonstrate.


I’m not sure what’s causing this or why this is even happening. I’ve already attempted looking through other posts and their solutions, the solutions mainly being to use collision groups but they did not work either. Any help would be appreciated!

1 Like

Yeah physics of the character replicate automatically even to the other players local state. I have investigated further and done some testing via a simple local script cloning a local part on both clients and pushing it around so that the positions desync from each other.

This means other players can push other peoples local object.

I believe you can solve it by using collision groups locally such that the block cannot be collided with anyone else except the local player.
Psuedocode, in a local script:

Edit 2: you might also have to create the collision group on server due to the restriction though you should be able to set collision groups of parts on the client.

local PhysicsService = game:GetService("PhysicsService")

local otherPlayersCollisionGroup = "OtherPlayers"
PhysicsService:CreateCollisionGroup(otherPlayersCollisionGroup)

PhysicsService:CollisionGroupSetCollidable("Default", otherPlayersCollisionGroup, false)
--Prevent them from interacting with the local enviroment at all

local everyOtherPlayer = {} -- other players character model
--use get players and get player added events to do the job
for i,part in pairs(everyOtherPlayer) do
	if part:IsA("BasePart") then
		PhysicsService:SetPartCollisionGroup(part, otherPlayersCollisionGroup)
	end
end
2 Likes

I’m not surprised that a client can replicate its physics simulation results if it has network ownership, but why are the 2 different clients even perceiving that part as being the same part? They each created it separately right? What does Roblox use as the identifier for the part? Just its GetFullName()? (Doesn’t make sense given multiple parts can have the same name.) Also, just to confirm, the part doesn’t even exist from the server’s perspective right? So it would have to be direct client<->client communication? (I would assume the server won’t pass on position data for an object it doesn’t believe even exists.)

I’ve attempted this script and it for some reason doesn’t work, I made sure that it puts the other players’ character parts in the collision group and everything. Still the same result as last time, and there were no errors at all.

Are you sure the parts is being cloned from a client script? Can the server see the part?

yeah I believe so, you can also see it in my video the player physics replicate, because of this the local part physics get effected as well.

Currently, working it out with @Trelakor via PM’s to give ideas on the characteradded, playeradded events and collision group setup properly to ensure no player collisions locally.

1 Like