How could i modify this minimap script to make the camera/map orientation editable?

Hi! i’m working on a game that uses a minimap, and i decided to reuse a minimap i had in a wayy older project of mine (that i’m pretty sure i got from a youtube tutorial), the problem: the minimap system rotation isn’t editable, and in this specific scenario, the orientation of the map right now is very annoying, and i wanted to change it, but i haven’t worked with cframes enough to be able to know how to make it so i can just adjust the rotation of the map inside the script… and since i’m very incompetent, i came here to ask for help, as one does… so yeah! code sample below:

local viewPort = script.Parent
local charPart = viewPort:WaitForChild("Character")

local buildings = workspace:WaitForChild("World")

buildings:Clone().Parent = viewPort

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

local height = 1000 --Lower the value to make the camera come closer.
local player = game.Players.LocalPlayer

viewPort.CurrentCamera = camera

game:GetService("RunService").RenderStepped:Connect(function ()
	local position = workspace.MAPFOCUS.Position
	local cf1 = CFrame.new(Vector3.new(position.X,height,position.Z), position)
	camera.CFrame = cf1
	charPart.CFrame = player.Character.HumanoidRootPart.CFrame
end)
1 Like
cf1 = player.Character.HumanoidRootPart.CFrame * CFrame.new(vector3.new(0,  Height, 0)) * CFrame.FromOrientation(-math.rad(90), 0, 0)

the camera should replicate the player’s character orientation with this
let me know if I make a mistake or it works

sorry for the very late reply! apparently this one never left the draft… the thing with it is not for it to replicate the character’s current orientation, it’s to make it so i can just rotate the orientation that the camera is inside the viewport at will, and have it stay like that, bc right now the item in the viewport is vertical and doesnt fit very well, its a big model so rotating the model would be inefficient (because minimap), having to work with rotated uis is also very annoying