How would I make a map display the entire map?

Hi, so recently I was making an RTS game, and I needed a map.

I made some code about it, and it works perfectly fine;

local whitelistedClasses = {
	"MeshPart",
	"Part",
	"UnionOperation",
	"Model"
}

local viewport = script.Parent
local camera = Instance.new("Camera")
camera.Parent = viewport
viewport.CurrentCamera = camera
camera.FieldOfView = 10
camera.CFrame = CFrame.new(Vector3.new(0,10000,0), Vector3.new(0,0,0)) * CFrame.Angles(0,0,math.rad(90))
local dots = viewport.Parent.Parent:WaitForChild("Dots")

local player = game.Players.LocalPlayer
local character = player.Character
local root = character:WaitForChild("HumanoidRootPart")

local runService = game:GetService("RunService")

local function v3tov2(vector3)
	local v2 = (viewport.AbsolutePosition + Vector2.new(100, 100)) + Vector2.new(vector3.X, vector3.Z)
	
	return v2
end

local function updateMap()
	for _,v in pairs(viewport:GetChildren()) do
		if not v:IsA("LocalScript") then
			v:Destroy()
		end
	end
	for _,v in pairs(dots:GetChildren()) do
		v:Destroy()
	end
	
	for _,v in pairs(workspace:GetChildren()) do
		if v:IsA("Model") or v:IsA("MeshPart") or v:IsA("Part") or v:IsA("UnionOperation") then
			if not v:FindFirstChild("Humanoid") then
				local clone = v:Clone()
				clone.Parent = viewport
			else
				local newV2 = v3tov2(v.PrimaryPart.Position)
				
				local point = Instance.new("Frame")
				point.Parent = dots
				point.Position = UDim2.new(0, newV2.X, 0, newV2.Y)
				point.Size = UDim2.new(0,5,0,5)
			end
		end
	end
end

while wait(0.5) do
	updateMap()
end

The only issue is, is that the viewport won’t encompass the ENTIRE map. I don’t know any kind of funny equation to do that kinda stuff, so please give me a hand

Please and thank you

1 Like

Could you provide a screenshot?

Sure

Have you tried making the FieldOfView for the camera higher?

Yes, I have. It just has the essentially the same results

I’m not quite sure on this one, have you tried using Images instead of viewports, majority of minimaps I’ve seen on Roblox are image based.

Okay sure, I’ll give it a try. The only thing I’m concerned about images is the fact that I would have to re-upload another image of the map every time I change the map

Nope, no difference in results

I found this post, it might help you! How to make minimap?

It’s not what I want. What I want is a viewport gui that shows the entire map, not just the nearby surroundings around you

Increase the size of the viewport to fit the entire frame?