I’m trying to make a viewport frame that looks the exact same as the player’s camera.
If you don’t understand what I mean, click here.
Is there any way I can do this?
I’m trying to make a viewport frame that looks the exact same as the player’s camera.
If you don’t understand what I mean, click here.
Is there any way I can do this?
First of all, you need to set the viewport current camera to the workspace current camera by using a local script, like this:
ViewportFrame.CurrentCamera = workspace.CurrentCamera
Then, you need to duplicate everything from the workspace and put those into the viewportframe. Note: Some models, like the player character, have their archivable set to false. This means you can’t clone them. If you want to clone the player’s character, you need to copy all the children inside the model instead, not the model itself.
After that, you need to check if any parts move or rotate and if so, update the duplicated part’s position and rotation to match the real one. You also need to make sure if any parts get added or deleted and update those into the viewportframe. That’s all.
Would the character count as a moving part?
Yep, it does. So you need to update every part inside a player’s character too.
I place everything into the viewport frame. But nothing shows up in the frame.
Oops, nevermind. I put the transparency to 0