Parts keep deleting themselves and causing errors

Hi. You already know who I am by my user, so no need to explain all of that. I yet again have another issue going on with a game of mine. (geez, so rareeeee. :expressionless:) My parts keep deleting themselves??? For the server, the parts are being shown. For the client, they are not there! My internet connection is fine too, so I’m not exactly sure what’s going on here.

  1. What do you want to achieve? Keeping these parts where they’re supposed to be. IN. THE. WORKSPACE.

  2. What is the issue? The parts literally keep deleting themselves! For no reason!

  3. What solutions have you tried so far? I’ve tried looking for any hidden scripts such as viruses or scripts I created a while back that might be causing this. Nothing. Just random part deletion!

I have no idea what’s going on. Is this a Roblox bug? Or am I just being stupid unknowingly??? Please, let me know. I’m so confused.

-- This code is in a Script with the RunContext set to Client!
local Field = game.Workspace:WaitForChild("Camera Field") -- Waiting for the model needed.
local BattleCam = Field:WaitForChild("Battle Cam") -- Waiting for the camera *inside* the model needed.
local Camera = game.Workspace:WaitForChild("Camera") -- Not sure if this is needed, but it's waiting on the workspace camera itself.

while wait() do -- Constantly checking for the needed models/parts.
	if Field ~= nil and Camera ~= nil then -- If these parts exist, then the following code will run.
		local Children = Field:GetChildren() -- Getting the models children or parts placed inside of it.
	    BattleCam = Field["Battle Cam"] -- The "Part" camera needed is turned into a variable to make code lines with the listed Instance easier.
	    Camera.CameraType = Enum.CameraType.Scriptable -- Making the camera scriptable, instead of free cam.
	    Camera.CFrame = BattleCam.CFrame -- Setting the players camera to the "Part" Camera's CFrame or Position and Orientation for new scripters.
		
		for i = 1, #Children do -- Getting the "Fields" children as listed earlier.
		    if Children[i].ClassName == "Part" and Children[i].Name ~= "Battle Cam" then -- If the children/parts inside of the "Fields" model ClassName is "Part" *but* it's name is not "Battle Cam" then the following code will run.
			    local Grounds = Children[i] -- Turning the children/Parts inside of the "Fields" model into a variable to make it easier to list.
			    Grounds.Transparency = 0 -- Making it visible to only the client.
				Grounds.Section2.Transparency = 0 -- Making it visible to only the client.
			end
		end
		print("Player camera fixed.") -- Letting me know/Client know that this script worked.
		break -- Breaking the while wait() do end to prevent infinite repeats.
	end
end

Is workspace.StreamingEnabled turned on? Please make sure it is off before we can further help by checking other factors

What do the errors even say? Which lines are emitting the errors?

Just turned it off. Sorry for MEGA late response. ;-;

The errors would be blue lines of code. Whatever line has a “WaitForChild()”, it completely stops working.

Since you turned it off, is your problem solved?

There has to be a red message in the output. Try scrolling up. If you see one that’s related, what does it say?

Yep. That was the issue :expressionless:. I’m not sure why that happens with streaming enabled, but it’s fine I guess.

StreamingEnabled loads and unloads portions of the game to improve load times, however, this also means some items won’t be replicated to the client until they are received by the client, which would usually take time depending on the user’s internet connection and PC specs.

This is useful for games with large and heavy maps, but not so much for small games.

Content Streaming on Roblox
Same link, but about Timing Delay, related to your post

1 Like

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