[SOLVED] Need help with viewport frame

Hello,
What I’m trying to do is make portals like the Portal game, but on Roblox (like the existing Tunneler game). So you can see what’s on the other side of the portal. So with viewport frames, but I’ve never used one…
I’ve tried looking at tutorials on Youtube but I only find tutorials where the image is frozen when I want it to move according to the player’s position or solutions on the devforum but I don’t really understand or it’s not really like I want to do (I THINK).
I tried to make a script (one for each VPF) with my limited knowledge but as expected, it didn’t work… However, here it is anyway (it’s the same for both but reversed (camera on TunnelA and displayed on VPFB)):

-- Create a new camera in TunnelB and display it in VPFA
local cameraA = Instance.new("Camera")
cameraA.Name = "CameraA"
cameraA.CFrame = workspace.World:FindFirstChild("TunnelB").CFrame
cameraA.Parent = workspace.World.TunnelB
cameraA.FieldOfView = 80

local GUI = script.Parent

local viewportFrameA = GUI.ViewportFrame
viewportFrameA.CurrentCamera = cameraA

and here’s the explorer just in case:

Capture d'écran 2024-06-28 122522

Capture d'écran 2024-06-28 122507

This should help:

And this uncopylocked game should also help:

2 Likes

Okay, I’ll check this later. Thank you.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.