StreamingEnabled does nothing

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    When I enable Streaming in my game, the loading doesn’t work at all…
  2. What is the issue? Include screenshots / videos if possible!

    Infinite loading screen if I enable Streaming…
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Tried to enable Streaming after loading completed from a serverscript, however, ROBLOX doesn’t allow serverscript to enable streaming via workspace, soo no other solutions found yet.

Loading script:

repeat wait() until script.Parent.Name == 'PlayerGui'
repeat wait() until script.Parent:FindFirstChild("Menu")
script.Parent:WaitForChild("Menu").Enabled = true
script.Parent:WaitForChild("Menu").Loading.Visible = true
script.Parent:WaitForChild("Stats").Enabled = false
local loadingScreen = script.Parent:WaitForChild("Menu")
local contenProvider = game:GetService("ContentProvider")

local CamPart = game:GetService("Workspace").CameraResources:WaitForChild("CameraPart")
local Cam = workspace.CurrentCamera
--local Blur = Instance.new("BlurEffect")
local Theme = script:WaitForChild("Theme")
--Blur.Name = "Blur"
--Blur.Size = 0
--Blur.Parent = Cam
local Point1 = CamPart
Cam.CameraType = Enum.CameraType.Scriptable
Cam.CameraSubject = Point1
local gui = game:GetService("StarterGui")
gui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
script.Parent:SetTopbarTransparency(1)

Cam.CoordinateFrame = CFrame.new(Point1.Position) * CFrame.Angles(0,0,0)

local Loading = 0
local thing = 0
wait(2)
Theme:Play()
for vol = 0, 1, .01 do
	Theme.Volume = vol
	wait(.1)
end

Theme.Ended:Connect(function()
	if thing == 0 then
		thing = 1
		Theme.SoundId = "rbxassetid://4773023695"
	elseif thing == 1 then
		thing = 0
		Theme.SoundId = "rbxassetid://4773058787"
	end
	Theme:Play()
end)
game:GetService("RunService").RenderStepped:connect(function()
    workspace.Camera.FieldOfView = 70 + script.Theme.PlaybackLoudness * 0.01
    workspace.Camera.CFrame = workspace.Camera.CFrame * CFrame.Angles(0, 
        0, math.rad(math.random(-script.Theme.PlaybackLoudness, 
        script.Theme.PlaybackLoudness) * 0.001)) + Vector3.new(
        math.rad(math.random(-script.Theme.PlaybackLoudness * 0.2, script.Theme.PlaybackLoudness * 0.2) * 0.010), 
        math.rad(math.random(-script.Theme.PlaybackLoudness * 0.2, script.Theme.PlaybackLoudness * 0.2) * 0.010), 
        math.rad(math.random(-script.Theme.PlaybackLoudness * 0.2, script.Theme.PlaybackLoudness * 0.2) * 0.010)
    )
   --game.Lighting.Blur.Size = script.Theme.PlaybackLoudness * 0.010

end)


--local toLoad = game.ServerScriptService:GetDescendants()
-- total = #toLoad

--for i,v in pairs(toLoad) do
	--loadingScreen.Counter.Text = "Loading: " .. i .. "/" .. total .. " " .. v.Name
--	loadingScreen.Loading.BarBG.Bar.Size = UDim2.new(i/total, 0, 1, 0)
	--contenProvider:PreloadAsync({v})
--

-- FINISH LOADING
wait(2)
script.Parent.Menu.Loading.Visible = false

wait(.1)
script.Parent.Menu.Title:TweenPosition(UDim2.new(0.5,0,0,0), "Out", "Quad", .4)
script.Parent.Menu["Create/Play"]:TweenPosition(UDim2.new(0.5,0,0.55,0), "Out", "Quad", .3)
script.Parent.Menu["Rules"]:TweenPosition(UDim2.new(0.5,0,0.65,0), "Out", "Quad", .4)
script.Parent.Menu["Credits"]:TweenPosition(UDim2.new(0.5,0,0.75,0), "Out", "Quad", .5)

--for b = 1, 16 do
--	Blur.Size = b
--	wait(.1)
--end

Cam.CFrame = CamPart.CFrame
print("LOADING ENDED")
wait(0.5)
print("StreamingEnabled = true")

That’s a Localscript in StarterGUI.

local p = game.Players.LocalPlayer
local m = p:GetMouse()
local CP = script.Parent:WaitForChild("Create/Play")
local R = script.Parent:WaitForChild("Rules")
local C = script.Parent:WaitForChild("Credits")
local Hover = script:WaitForChild("Hover")
local Tips = {
	"Did you know that you can get different views of the city from rooftops and balconies?",
	"Hidden Society California gives you wonderful job opportunities!",
	"California is the most populous U.S. state and the third-largest by area.",
	"You can travel from downtown Los Angeles to South Central and East Los Angeles!",
	"Rest In Peace Nipsey Hussle and Kobe Bryant #TMC #MambaMentality",
	"Looking for somewhere to purchase cheap clothing? head down to Lucky Bargain!",
	"If you come across any bugs or glitches, feel free to contact 49dec!",
	"Life is what you make it, so make it fun!",
	"49dec was here, because I'm cool :)"
}

local CPBool = false
local RBool = false
local CBool = false

local gui = game:GetService("StarterGui")
local menu = script.Parent.Parent:WaitForChild("MainMenu")
local Camera = workspace.CurrentCamera
local menu2 = script.Parent
local fade = script.Parent.Fade

local Player = game:GetService("Players").LocalPlayer
local notification = function(Title, Txt, Icon, Time)
	game:GetService("StarterGui"):SetCore("SendNotification", {
		Title = Title,
		Text = Txt,
		Icon = Icon,
		Duration = Time -- Defaults to 5 secs
	})
end
function SetCore(Core,Value)
	game.StarterGui:SetCoreGuiEnabled(Core,Value)
end

function GetTips()
	local tip = math.random(1,#Tips)
	local textip = script.Parent.Loading:WaitForChild("Tips")
	local tiptab = Tips[tip]
	for T = 1, #tiptab do
		textip.Text = string.sub(tiptab, 1, T)
		wait(0.1)
	end		
end


function Proceed(Bool)
	if Bool == "true" then	--meaning has data
		SetCore(Enum.CoreGuiType.Chat,true)
		menu = script.Parent.Parent:WaitForChild("MainMenu")
		for i = 1, 0, -.01 do
			fade.BackgroundTransparency = i
			menu.Theme.Volume = i
			wait(.01)
		end
		menu.Theme.Volume = 0
		Camera.CameraType = Enum.CameraType.Custom
		Camera.CameraSubject = p.Character.Humanoid
		menu2.Enabled = false
   		Player.PlayerGui:SetTopbarTransparency(0.5)
		SetCore(Enum.CoreGuiType.All,true)
		Player.PlayerGui:WaitForChild("Stats").Enabled = true
    	SetCore(Enum.CoreGuiType.PlayerList,false)
		menu2:Destroy()
		menu:Destroy()
		game.ReplicatedStorage.RemoteEvents.UpdateCharacter:FireServer()
    	--menu:Remove() 
	elseif Bool == "false" then
		--meaning has no data
		menu2.Enabled = false
		Player.PlayerGui:WaitForChild("Custom").Enabled = true
	end
end

CP.MouseButton1Click:Connect(function()
	local PlayerData = Player.Data
	local Data = PlayerData:WaitForChild("HasData")
	Proceed(Data.Value)
end)

script.Parent.Rules.MouseButton1Click:Connect(function()
	if not Player.PlayerGui:FindFirstChild("Rules") then
		local Rules = game.ReplicatedStorage.Resource.Rules:Clone()
		local Rules = game.ReplicatedStorage.Resource:WaitForChild("Rules"):Clone()
		Rules.Parent = Player.Backpack
	end
end)

--script.Parent.Rules.MouseButton1Click:Connect(function(notification)
--	notification("Information!", "game Rules can be found on the games description!",nil,15)
--end)

script.Parent.Rules.MouseButton1Click:Connect(function()
	notification("Information!", "game Rules can be found on the games description!",nil,15)
end)

m.Move:Connect(function()
	if CPBool then
		CP.Line:TweenSize(UDim2.new(1,0,0,1),"Out", "Quad", .2)
	elseif CPBool == false then
		CP.Line:TweenSize(UDim2.new(0,0,0,1),"Out", "Quad", .2)
	end
	if RBool then
		R.Line:TweenSize(UDim2.new(1,0,0,1),"Out", "Quad", .2)
	elseif RBool == false then
		R.Line:TweenSize(UDim2.new(0,0,0,1),"Out", "Quad", .2)
	end
	if CBool then
		C.Line:TweenSize(UDim2.new(1,0,0,1),"Out", "Quad", .2)
	elseif CBool == false then
		C.Line:TweenSize(UDim2.new(0,0,0,1),"Out", "Quad", .2)
	end
end)

CP.MouseEnter:Connect(function()
	Hover:Play()
	CP.Line:TweenSize(UDim2.new(1,0,0,1),"Out", "Quad", .2)
	CPBool = true
	RBool = false
	CBool = false
end)
CP.MouseLeave:Connect(function()
	CP.Line:TweenSize(UDim2.new(0,0,0,1),"Out", "Quad", .2)
	CPBool = false
end)
R.MouseEnter:Connect(function()
	Hover:Play()
	R.Line:TweenSize(UDim2.new(1,0,0,1),"Out", "Quad", .2)
	RBool = true
	CPBool = false
	CBool = false
end)
R.MouseLeave:Connect(function()
	R.Line:TweenSize(UDim2.new(0,0,0,1),"Out", "Quad", .2)
	RBool = false
end)
C.MouseEnter:Connect(function()
	Hover:Play()
	C.Line:TweenSize(UDim2.new(1,0,0,1),"Out", "Quad", .2)
	CBool = true
	CPBool = false
	RBool = false
end)
C.MouseLeave:Connect(function()
	C.Line:TweenSize(UDim2.new(0,0,0,1),"Out", "Quad", .2)
	CBool = false
end)

while wait(7) do
	GetTips()
end

ButtonAnimation LocalScript for the loading gui ^

Did you write that script?

Also what are you trying to achieve here?

Achieving StreamingEnabled to work alongside my loadingscreen, however, if I disable StreamingEnabled, the loading screen works perfectly fine.

I’m trying to reduce in-game lag by a bit or majority with streamingenabled, and that way I can continue on my game development.

1 Like

This is most likely occuring because Streaming Enabled doesn’t have the entire workspace available for the CLIENT (server can see everything fine).

Are you receiving any sort of infinite yield or errors? Specifically with this line:

local CamPart = game:GetService("Workspace").CameraResources:WaitForChild("CameraPart")

What I suggest is you either store the part in replicatedStorage and reference that part OR you only define the necessary information within the script (such as the position/cframe, etc).

No errors or warning is popping in even if I had StreamingEnabled off or on, and that’s used for positioning your camera when it’s done loading, like a game menu.

Alrighty, than lets start the debugging process! What I want you to do is put a couple of prints in your script. One at the start and end of your script. One before you define campart and after you define it, just print campart itself.

What this basically is going to do, is narrow down the issue. For example, if something doesn’t print than we know it has to do with the code above!

1 Like

Just call the print function like this?

print()

Ye, so you basically would be adding prints like print("test 1 blah") and/or printing variables to see if they’re what we want them to be: print(camPart)

Make sure you have output open when testing in studio!

local CamPart = game:GetService("Workspace").CameraResources:WaitForChild("CameraPart")
print(CamPart)
local Cam = workspace.CurrentCamera
print(Cam)

I’ve added this, nothing in client or server within the console.

And the CameraPart it’s locating does exist in the Workspace.

Thats the warning I mentioned earlier. You said there were no infinite yield warnings. What that error means (in broad terms) is that the script is yielding (pausing) until it finds the cameraPart in workspace.

However since you have streamingEnabled on, not everything is available to the client. This is why it seems like the part doesn’t exist!

Refer back to my previous post about how to go about changing this.

1 Like
local CamPart = game:GetService("ReplicatedStorage"):WaitForChild("CameraPart")

It did work, however, it made the camera go no where but an empty skybox when loading in for the loading screen and clicking play

Is it possible to clone it from the replicatedstorage into the workspace?

local CamPart = game:GetService("ReplicatedStorage"):WaitForChild("CameraPart"):Clone(workspace.CameraResources)

Perhaps this would work?

Nevermind, this did nothing at all.

As far as I recall. It still won’t work depending on if the parts position is out of the streamingRadius when parented to workspace.

How about instead of setting the cameraSubject. You just tween/CFrame the camera to the cameraParts position.

1 Like