Is it possible to show the terrain in ViewPortFrame?
Here's my script
local player = game:GetService(“Players”).LocalPlayer
local character = player.Character
local cam = Instance.new(“Camera”, script.Parent)
cam.CameraType = Enum.CameraType.Scriptable
script.Parent.ViewportFrame.CurrentCamera = cam
while true do
cam.CFrame = CFrame.new(character:WaitForChild(“HumanoidRootPart”).Position +
Vector3.new(0, 50,0), character:WaitForChild(“HumanoidRootPart”).Position)
game:GetService(“RunService”).RenderStepped:Wait()
end
No, you can not show terrain in viewport frames.
Correct me if I’m wrong, but since you’re obviously making a minimap, why not follow this tutorial or this one.
2 Likes
As @ProfessionalPlayer60 already stated, terrain cannot be rendered in a ViewportFrame. You can’t clone the terrain instance or load terrain in any object you want, so there’s no current way to tell the ViewportFrame you want to render it!
You could theoretically use parts in the VPF instead of terrain to achieve this effect but that’s probably more trouble than it’s worth.
Also, gonna get a but nitpicky here, but instead of using a while loop that literally waits for RenderStepped() you could just bind your code directly to RenderStepped. That saves time and looks better.
2 Likes
If they would just make it be able to display what a camera sees it would be so much easier and you wouldnt have to duplicate crap, I really want to be able to display everything in it easily. Including terrain and other stuff. I am triggered with the way viewportframes work rn
10 Likes