I need help with my Mini Map

Hello. I’m currently trying to make a Minimap for a big Game I planned to make. But I have some problems.

I can’t find a way to fix the Zoom. The Minimap Zooms like the Player zooms Ingame.

Help please

The Script I use (Local Script):

script.Parent.MiniMapService.CurrentCamera = game.Workspace.CurrentCamera

if true then
	script.Parent.MiniMapService.CurrentCamera = game.Workspace.CurrentCamera
	script.Parent.MiniMapService.CurrentCamera = game.Workspace.CurrentCamera

I already tried to fix the Zoom of the player, but I want the player to zoom freely.
What do I have to do so the Zoom is fixed in the Minimap and not dynamic?

(Sorry if I made any mistakes here. Its my first Topic on this Forum)

1 Like

Hey @Danielking1001!

Could you please describe the issue a little better? I don’t really understand what you’re trying to acomplish, although I understand what a minimap is, you seem to be fixated on some kind of zoom? I’m not sure what you mean by zoom, if you’re talking about the players camera zooming away and to their character then I’m not sure what that has to do with the minimap.

Please describe the issue a little more and keep in mind that no one on this board is able to read your mind. Thanks!

I try to explain it better:
On the Minimap (Minimap Camera). The Zoom Distance should be static (ex. 128 Zoom distance)

The player camera should be able to zoom freely. (0.5 - 64 Zoom Distance)

On the picture you can see: Player Zoom and Minimap Zoom are the same. Minimap Zoom should be frozen, so it doesnt zoom in if U zoom in the camera.

Game Example: RoCitizens. The minimap Zoom is static, and the player Camera is free.

I hope its understandable.

So this can be a bit complicated depending on what you want.
If you want the MiniMap Camera to stay Exactly in one spot you could make new Camera in the viewport, name it MiniMapCam, Position your MAIN CAMERA IN STUDIO where you want MiniMapCam and in the commandbar in studio type

game.StarterGui.MiniMap.Frame.MiniMapService.MiniMapCam.CFrame = workspace.Camera.CFrame

1 Like

I don’t need the Minimap itself to be frozen. I need the Minimap Zoom to be frozen.

It should still follow the Player, but zoom should Always be the same. Regardless of the player Camera zoom

Oh okay, you want to be looking at:

I’ve tried to add a CFrame.new as Zoom Distance, but it doesn’t work. The zoom is still the same like the player is zooming. I think there is no Distance property in Camera.

Minimap Render [RoRenderV2] - Resources / Community Resources - DevForum | Roblox

1 Like

Hey @Danielking1001!

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.

With 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 X and 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!


Hi. This sadly doesn’t work.
My Charater gets teleported under the ground and dies immediately. It doesnt affect the minimap camera. It only affects the Player Camera

I guess I’ll be fine with what I have. Thanks for your help! Finally some friendly people :smiley:

Hi Dan, uhm you’ve done the only thing I’ve asked you to do to make this work wrong.

You need to set the Camera variable not to the worlds camera, but to the ViewportFrame's camera.

Simply create a new camera and set it to the players head then change the offset until you get it to how you want it to look. I’m assuming you want the minimap to follow where the player is looking.

I exactly made that. And it didn’t work. It doesn’t matter what camera I use. The cam gets stuck and I get loop killed