I cant find any documentation on how I would make a block which acts like a security monitor.
check out ViewportFrame!
itâs a rough version of copying what a camera/view sees into a GUI frame, but itâs very basic and probably wonât duplicate what you want to do. youd have to rebuild everything into the âviewportâ (since it is its own âworldâ) and the lighting isnt very good.
but theres two different ways you could go around this limitation that roblox has:
-
give the camera a âno signalâ effect, but allow the player to âzoom inâ to the camera to look. you would instead be using the playerâs camera to look around the map, and you donât need to add anything other than whatâs already there for the player to see.
-
get some pre-rendered images of where the camera is going to look, and set it as a GUI image background. any figures you want to put over it, you can overlay together in layers.
if thereâs going to be some dynamic things actively moving in it though (ex. players), you might want to combine it with aViewportFrameand make some code that copies the playersâ position to the viewportâs world.
not too much to choose from though since roblox is limited in the power it can use. it has to be able to support both PC and tiny mobiles that warm up to the temperature of the sun, of course.
good luck!
im using it for a CCTV purpose though (to monitor a level crossing) so idk what is possible, the first option could work
yeah, it depends on how much activity you expect to be happening in the monitor. if its just still images, the second option works best (since itâs hard to replicate actual roblox lighting to ViewportFrames. but if you arenât concerned about the players needing to have mobility and not be locked in after zooming into a camera, then number 1 is easiest to do! ;D
well the camera is located in a signal box which needs mobility (as the signaller will be watching many trains), and they need to see any cars or trains which are moving - so neither solution seems too good
I wouldnât recommend using ViewportFrames. Theyâre hard to work with and are bad for performance. Youâd need to use a loop to continuously update the ViewportFrame, and that can be taxing.
Iâd rather use a block that when clicked sets the playerâs camera to the CCTV.
If you absolutely need to use ViewportFrames, display it only to the signaller (and perhaps other players in the signal box). Update it on the client (in a localscript). Have it enabled only when the level crossing lowers (just like IRL), until the signaller confirms that the crossing is clear, after which you would disable it.
PS, Iâm a fellow railway game developer.
im not too sure how you would implement it in a way that doesent seem unrealistic
You may used a â.Rendersteppedâ event which sets the player camera cframe to the cframe of a part acting as the camera. If you want the actual monitor to show the CCTV camera area then using a viewport frame would be your best option but i wouldnât recommend that