Im basically making a Plague Inc. game, Making the World map an UI wasnt a good idea so I just put some huge parts with decals on it, with a camerapart above.
Recently I have been making this zoom in mechanic. It is doing well for now but I’ve noticed that the map cuts off from sides when the screen/window is square. My Idea is to move the camerapart higher above if the screen/window is square, but im not sure how to do it
-
View of the map and camera parts
-
Gameplay
-
The script I need help with
local normalcamattachcframe = CFrame.new(-3.08400011, 83, 151.5, -1, 0, 0, 0, 0, 1, 0, 1, -0)
local squarescreencamattachcframe = CFrame.new(-3.08400011, 103, 151.5, -1, 0, 0, 0, 0, 1, 0, 1, 0)
if workspace.Camera.ViewportSize.X <= 850 and workspace.Camera.ViewportSize.Y <= 850 then
TweenService:Create(workspace.CamAttach, TweenInfo.new(.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = squarescreencamattachcframe}):Play()
else
TweenService:Create(workspace.CamAttach, TweenInfo.new(.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = normalcamattachcframe}):Play()
end
-- I used tweens instead of directly setting the cframe because I was planning on tweening it when the window size changes, a cool smooth transition
this method wasnt a good idea since there are devices with low resolutions such as iphone 4, 5, etc.
I appreciate any feedback and will definitely give credits if I get this working