How would I give a local script access to a specific camera?

I’m new to ViewportFrames and I’m trying to make a customization screen using ViewportFrames that display the items. Currently for each item, I place them inside of the ViewportFrame, and then clone the workspace camera and set that camera as ViewportFrame.CurrentCamera. All of this data is stored inside of a gui in StarterGui.

When in studio mode, this works well, but when the Gui is replicated to the PlayerGui, the cameras disappear. Does anyone have a solution for how I could access these cameras from a local script?

I saw a similar post that said create a new instance of a camera and set all of its attributes to the one you want, but that didn’t work for me.

1 Like

Ah, I remember having this issue once. IIRC, any “additional” camera instances other than workspace.CurrentCamera are deleted when the game starts. Super annoying, basically means you have to set up every camera using Instance.new(“Camera”) and then setting all the properties :frowning:

If anyone can confirm/deny that’d be neat

1 Like

Yeah after messing around with it for a while, I think you’re right. I ended up just having to create instances of cameras but if anyone out there has any other options, I’d love to hear them.

1 Like