Weird Model Cloning Behavior [Unsolved]

Yo! So recently I’ve been working on some UI/Camera based game, and it all worked finr untill I have stumbled a weird issue. Honestly I am puzzeled, so let me get some context.

--!strict

local positions = script:GetChildren()



game.ServerScriptService.BindableEvents.OnPlayerJoin.Event:Connect(function(player : Instance, ScreenResolution : string)
	print(ScreenResolution)
	local PlayerPlotFolder = game.Workspace.PlayerFloat.PlayerPlot.Presets.PlotDataFolderPreset:Clone()
	PlayerPlotFolder.Name = player.Name
	PlayerPlotFolder.Parent =  game.Workspace.PlayerFloat.Players
	
	
	for _,v in pairs(positions) do
		if not v:GetAttribute("Taken") then
			v:SetAttribute("Taken", true)
			PlayerPlotFolder.PlayerPlotInternalData.Poistion.Value = v.Value
			local PlayerGameZone : any
			PlayerGameZone = game.ReplicatedStorage.PlayerPlotAssets.PlayerPlotPages:FindFirstChild(ScreenResolution):Clone()
			PlayerGameZone.Parent = PlayerPlotFolder
			PlayerGameZone:MoveTo(v.Value)
			PlayerGameZone.Name = "PlayerPlotModel"
			
			
			
			break
		end
	end
end)

This code right here, once a player join assigns them a “plot” which is just a Vector3 value. As far as i checked that part worked all right and each player got different coordinates. What this snippet does it essnetially copy a model from replicated storage and paste it into the respective player folder in workspace.

Model that is being copied along with all its descendants:
image

As seen on the server side screenshot below eveything seems to be quite right: We have 2 players in the local test, each gets their model copied at different coordinates,. Okay, wonderfull!

For a little context these will be sort of pages /windows that you move using awsd, where by pressing a you move to the page on your right. (Below a little demonstartion)
20240705-0103-58.3783021-ezgif.com-video-to-gif-converter

( the camera gets switched between two camera parts, (CameraPosition parts from the explorer screenshot above) (I also made them on vectors so they’re easily expandable :smiley: but thats aside from the topic)

Now here’s what happens when i press local playtest

Well so obviosuly i looked what was the issue and to my suprise the parts just werent there. camera parts that came along the duplicated model just were non existent on the second client. Let me show a depiction of what i am reffering to

Player 2 litteraly has no CameraPosition Parts even though they all should have been there? Well my first guess was that silly me made a mistake somewhere a small one. But to my suprise they parts are there on the server side???


Server side image above^^

So to my understanding The fact that the parts are missing somehow replicated to both clients??? Yet not the server? I have no idea why that is and i was even more suprised seeing that the partss are still rendered by the server. Especially that the sciprt responsible for moving the models is server side.

Any help or explanation would be appreactied Thank you in advance! I can provide more code snippest but only these are reponsible for dupiclating the model itself.

1 Like

Make sure all the parts are anchored. If a camera part goes ‘live’ during the play test, unanchored/unwelded, it will fall below a set y point and disappear/delete.

This could be your issue, may not be

1 Like

I don’t think that maybe the case since it still exist on server side.

maybe you have streaming enabled turn on and second player too far away to load that in?

if that is the case try setting ModelStreamingMode in PlayerPlotModel to Persistent

image

1 Like

Oh my god. Thank ya so much. I spent quite a lot of time searching for a solution yet never considered this as the culprit, I had no idea streamingeneabled was now on by default? That’s absurd, nevertheless the tysm

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.