Thanks for the clarification! I know exactly what you’re talking about now and I can help!
So I understand that you’re using a
ViewportFrame and then using another
Camera in there to render the minimap.
Well assuming that you want the minimap to follow the player, what you can do is use
RunService to run on
Stepped which will allow you to set the CFrame of the minimap camera every single frame.
CFrame's it’s actually really easy to give it a position and where you want it to look because those are the first two parameters in
CFrame.new()! You’ll want to take the
Z coordinants of the players
HumanoidRootPart and then set the
Y value manually, you said 128?
That would work like this: (running in a local script by the way)
local RunService = game:GetService("RunService")
local Player = game:GetService("Players").LocalPlayer
local Camera = "idk" -- Youll need to set this to the ViewportFrames camera, wherever that is.
local Character = Player.Character or Player.CharacterAdded:Wait()
if not Character then Character = Player.Character or Player.CharacterAdded:Wait() end
if not Character.PrimaryPart then return end
local X = Character.PrimaryPart.Position.X
local Y = 128
local Z = Character.PrimaryPart.Position.Z
Camera.CFrame = CFrame.new(Vector3.new(X, Y, Z), Character.PrimaryPart.Position)
I hope you can integrate this, and that it helps!