Recently, I’ve been using ViewportFrames, with a camera parented to it. However, I found that the camera will automatically disappear after the place is closed, the next time I launch an editing session, I can’t see the camera under the ViewportFrame. And by running ViewportFrame:GetChildren(), I can see that the camera indeed disappeared, ensuring that it isn’t a problem of the display in Explorer window.
Expected behavior
The camera should not disappear, it is just abnormal.
Note that when changing Workspace.CurrentCamera to a new Camera, all other Cameras directly descending from Workspace will be destroyed. If you need to store multiple cameras and swap between them on demand, it’s recommended that you store them in a Folder or Model under Workspace, inside which they will remain even when CurrentCamera is changed.
I am not sure whether or not this behavior is a bug or not, but it doesn’t seem to be clearly documented. The only cameras which are documented to be removed are ones which are direct children of workspace. It would be helpful to see this behavior change if possible.
Are the Cameras just disappearing when you playtest the game, or are they genuinely missing in Studio edit mode as well?
Because Cameras don’t replicate. If you manually create a separate Camera object in Studio, it won’t be visible to the client. You will have to manually Instance.new() a Camera via a LocalScript to use in your ViewportFrame.
I’ve had this issue in the past and I still don’t know the exact reason, but my guess is that cameras stay on the client even in studio and aren’t replicated at all.
I don’t believe its currently possible to keep cameras, but you should create the camera on the client during runtime with a script instead.
Hi Gavin, it looks like this issue only occurs when team create is enabled. I’ve forwarded it to the correct teams. If you absolutely need cameras in the workspace and can disable team create, that is an option, but we’ll look in to solving this as soon as we can!