Can I render a camera In a part in workspace?

Is it possible to place a camera somewhere in the workspace and render the camera’s output on a part also in workspace?

1 Like

I don’t got what you mean by that
You want your camera to be positioned at the part in the workspace?

If yes, then heres a little example:
insert a script (local script) and type the following code

local cameraPart = workspace.CameraPart -- the part where you want camera position to be
local camera = workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptable -- makes camera not movable and makes it scriptable for the developers
camera.CFrame = cameraPart.CFrame -- Sets the camera position (includes height), rotation to the part's position/rotation.

To add to this, setting camera.CameraType once may fail, you should keep retrying until camera.CameraType == Enum.CameraType.Scriptable returns true.

:+1:

repeat 
  task.wait()
  camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable

I meant that I want to make realistic portals that I can see trough, like in portal2
That’s why I want to render a camera’s output on a part

ahh so realtime portal? that can show the other side in the real time
just like that vivian’s game?

I don’t know what vivian’s game is, but yes that’s what I’m trying to achieve

I’m pretty you could use SufaceGuis and ViewportFrames to achieve this.

You may want to check this:

Also, you may want to check ViewportFrames

The resource egomoose sent isn’t greatly optimized, but @Nolas154_YT you can give it a try.
It can be really laggy for low end devices so make sure to optimize it properly.

Polling is sub-optimal, that practice is far too frequent.

local camera = workspace.CurrentCamera
if not camera.CameraType == Enum.CameraType.Fixed then
	camera:GetPropertyChangedSignal("CameraType"):Wait()
end
print("Hello world!")