Minimap ViewportFrame Character no longer works?

In my coding I have a script where the viewport is a minimap and it should show a topview of the map but instead it faces the front of the map.

image

The script:
local viewPort = script.Parent:WaitForChild(“ViewportFrame”)
local charPart = viewPort:WaitForChild(“Character”)

local roads = game.Workspace.Map

roads:Clone().Parent = viewPort

local camera = Instance.new(“Camera”, workspace)
camera.CameraType = “Scriptable”

local height = 200
local player = game.Players.LocalPlayer
player.CharacterAdded:Wait()

viewPort.CurrentCamera = camera

game:GetService(“RunService”).RenderStepped:Connect(function ()
local position = player.Character.HumanoidRootPart.Position
camera.CFrame = CFrame.new(Vector3.new(position.X,height,position.Z), position)
charPart.CFrame = player.Character.HumanoidRootPart.CFrame
end)

1 Like

maybe you are using the wrong orientation cframe, from the photo you provided it seems like it shows the front of the map instead of showing the “topdown” view you wanna achieve

1 Like

Well won’t that just make it a camera?