Problems with client-side physics/rendering

Im trying to make a single player action game which really needs responsive combat and smooth experience. Right now im rendering the map on the client by parenting map and npc to workspace.CurrentCamera or by cloning server sided object on the client. Howerver lots of time this happens.

My simple code has no error and i have no clue of whats causing this (might be something extremely simple that i forgot). Any help appreciated thanks.

RenderCode

for _, replicate : Instance in workspace.Replicated:GetDescendants() do
if replicate:IsA(“Model”) then

	-- Same result 
	---local copy = replicate:Clone() copy.Parent = workspace replicate:Destroy()

	replicate.Parent = workspace.CurrentCamera
	
	print("Copied "..replicate.Name)
	
	
	-- entity collision (not related)
	if replicate.Parent.Name == "Entities" then
		for _, c in replicate:GetDescendants() do
			if c:IsA("BasePart") then
				c.CollisionGroup = "character"
			end
		end
	end
end

end

Iirc parenting things under the camera messes with replication. Did you try parenting it else where?

Yep both parenting to currentCamera (on client) and destroying the server side object, and cloning in from the client has this same result. Probably has to do with assemblySleepState so im wondering if there is a way around this since i’ve already seen this being done.

another approach could be:

  • when server starts move everything from workspace to ReplicatedStorage/(let’s say)Workspace
  • when client starts, clone everything from ReplicatedStorage/Workspace to workspace

have not checked that, just speculating.

Dont think the ownership is the problem, everything is correctly created by the client and the server isnt interefering (since its all local script). The problem is the physics sleeping mid action. Here i found a video where this was achieved with ragdoll fully client sided