StreamingEnabled destroying client created objects

I create items on the client when a player joins, but with StreamingEnabled it completely destroys them from existence

In workspace
image

When playing in regular game
image

When playing with StreamingEnabled
image

The code is being called on start, but I don’t know how to make it so when the parts are streamed in, their children also come back
image

function EggController:SetupEggs()
	print("SETUP")
	for _, egg in pairs(CollectionService:GetTagged("Egg")) do
		-- Add effects
		local Effect = Effects.Egg.Effect:Clone()
		Effect.Parent = egg.PrimaryPart
		Effect.Area.Position = egg:GetPivot().Position
		Effect.Core.Position = egg:GetPivot().Position
		
		local Weld1 = Instance.new("WeldConstraint")
		Weld1.Part0 = egg.PrimaryPart
		Weld1.Part1 = Effect.Area
		Weld1.Parent = egg.PrimaryPart
		
		local Weld2 = Instance.new("WeldConstraint")
		Weld2.Part0 = egg.PrimaryPart
		Weld2.Part1 = Effect.Core
		Weld2.Parent = egg.PrimaryPart
		print("HERE")
		UI.EggStats:Clone().Parent = egg.PrimaryPart
	end
end

Detecting Instance Streaming | Content Streaming | Roblox Creator Documentation

When objects stream out, it’s content will be destroyed clientside

Detect when the object is streamed back in from provided document
and do the setup on that specific object

You’re already using tags, so this should be pretty simple

That setup loop when the client starts, should be kept alongside the stream in function

It is being streamed back in though, as the part exists. It’s children aren’t being streamed back in tho, even when I’m standing on top of the part

1 Like

When object streams out, it does not keep what is locally created

You have to make an event to setup your clientside effects again when the object streams back in

Example is in the provided documentation

1 Like