Assets not loading fully in Roblox Studio

Im testing out a menu screen that teleports you to a different experience when you click on the notebook

The main issue is that I have to constantly replay the game again and again because sometimes when I play test it, it doesn’t load the camera or even any of the assets that are necessary to make the menu function

Showing less assets being loaded


Camera not working

Intended purpose


I tried other ways to fix it by re-installing Roblox Studio or clearing out cache’s but for some reason this didn’t fix any of the issues. Ive also tried to wait for 10-20 mins to see if the assets were fully loaded but it didn’t work.

Im not sure if it’s because of my loading screen or if it’s something else entirely.

Any errors in your Output?
Are you using a WaitForChild for your camera in your script, or for anything else that may cause the script to freeze if something isn’t there when the script goes to reference it?

No, it doesnt show any errors, but I actually did not use WaitForChild in the script

local cam = workspace.CurrentCamera
local camPart = workspace["CamPart"]
local mouse = game:GetService("Players").LocalPlayer:GetMouse()

repeat
	wait()
	cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable

local maxTilt = 7
game:GetService("RunService").RenderStepped:Connect(function()
	cam.CFrame = camPart.CFrame * CFrame.Angles(
		math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
		math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
		0
	)
end)

Try using WaitForChild on your first 2 lines.

Also, why have this because it would only ever repeat once?

repeat
	wait()  --you should also start using task.wait() instead of just wait()
	cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable

It doesn’t work if I use WaitForChild for CurrentCamera so I had to find it that way, but for the second line I made the change for WaitForChild

1 Like

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