script.Parent.MiniMapService.CurrentCamera = game.Workspace.CurrentCamera
if true then
script.Parent.MiniMapService.CurrentCamera = game.Workspace.CurrentCamera
else
script.Parent.MiniMapService.CurrentCamera = game.Workspace.CurrentCamera
end
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)
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!
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
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.
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()
RunService.Stepped:Connect(function()
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)
end)
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
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.