So I’m definitely totally not making a fnaf game so I want to display footage from a camera on a screen within the game in real time. I looked around but couldn’t find anything that would help me.
Visual for clarity
So I’m definitely totally not making a fnaf game so I want to display footage from a camera on a screen within the game in real time. I looked around but couldn’t find anything that would help me.
Visual for clarity
that is running 60 fps Prerender
or Renderstepped
and rendering workspace’s all descandets in Viewportframe
or use task.wait()
(it has limit to 60 fps, wont go higher than that number)
I don’t understand what you mean. Elaborate.
Me neither…
Anyways, I think if you’re doing it in real time the easiest option is just to save the positions of all the cameras, set the position of the player’s camera, and use some type of GUI to make it look like they are watching a screen. It is unfortunately pretty hard to do what you want to do perfectly though.
Reference:
Roblox Docs - Camera.CFrame (set position of camera to where the artificial camera is)
Roblox Docs - Camera.CameraType (set to Enum.CameraType.Scriptable before moving camera)
Side note: you should probably post this kind of thing in Help and Feedback > Scripting Support next time
For looking at the screen viewing the camera without being in a UI as you’re saying it’s quite simple, just use a viewport frame and render all of the area the camera is viewing within that viewport (as Micro said) and then put the viewport frame on a surface GUI on the part.
Echoing what the others suggest, which is to use a ViewportFrame that is inside a SurfaceGui which is adorned to the TV screen. (For the ViewportFrame to work, it needs to be parented under the player’s PlayerGui - so parent the SurfaceGui under the PlayerGui and set the Adornee to the TV screen part.)
In your case you’d have a Camera inside the ViewportFrame which is set to the CFrame of the CCTV object. You’d duplicate the geometry of the level (*BE CAREFUL when doing this, only clone what the camera can see, otherwise it will impact performance if you have too many parts to render in the ViewportFrame).
If you need to also view moving characters inside this CCTV, then you need to create a duplicate of the characters that are currently visible within the CCTV bounds, and you can track their animations either by using Humanoid.Animator.AnimationPlayed
or loop every few frames to update the Motor6D.Transform
of all the limbs to replicate the movement.
Ok, I’ll look into the viewport thing. Thanks