Camera Instance stored in ReplicatedStorage returning nil?

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!
    Hello developers! I have a project where I want to get a camera from ReplicatedStorage and use it for my local script located in StarterGui.
  2. What is the issue? Include screenshots / videos if possible!
    I keep get an error saying ‘infinite yield possible on ReplicatedStorage.Cameras:WaitForChild(“preservedCamera”)’
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried using :FindFirstChild() or :WaitForChild(), but those have not worked, at least to my knowledge.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage:FindFirstChild("RemoteEvents")
local HatchPet = RemoteEvents:WaitForChild("HatchPet")

local Cameras = ReplicatedStorage:FindFirstChild("Cameras")
local preservedCamera = Cameras:WaitForChild("preservedCamera")

Screenshot 2024-10-31 at 11.08.35

Also I don’t think you should create new cameras and use them, because there are no ways to actually assign clients to each camera. These instanced cameras are only meant for thumbnails of models in the past.

1 Like

I’m using the camera for the ViewportFrame in my game.

That’s not exactly how you execute the implementation of ViewportFrames.
https://create.roblox.com/docs/reference/engine/classes/ViewportFrame

Pay attention to the example code.

1 Like

Okay, I guess I have to set the CFrame manually through a script instead of cloning a camera and getting its CFrame. :+1:

1 Like