How can i make a 2D camera?

Hi!

I want to create a 2D camera for a little prototype, i have the basic movement of the character and the scene done. but i don’t know how to make a 2D camera because there isn’t even a 2D camera object.

This is my current progress:

Any help is appreciated, thanks

Well, it’s not that simple to answer, so I have to ask you.
Do you know what OOP is?

Try this:
StarterCharacterScripts:

TweenService = game:GetService("TweenService")
RunService = game:GetService("RunService")
Player = game.Players.LocalPlayer
Camera = workspace.CurrentCamera -- Camera
Character = script.Parent

wait()
Camera.CameraType = Enum.CameraType.Scriptable
Part = Instance.new("Part", workspace) -- Part For Camera

Part.Size = Vector3.new(1,1,1) -- Szie
Part.Name = Player.DisplayName.."'s Camera" -- Name
Part.Locked = true -- Can Click on
Part.Transparency = 1 -- Invisible
Part.CanCollide = false -- can Touch
Part.Anchored = true -- Cant fall
Part.Orientation = Vector3.new(0,0,0) -- Set this to whatever, not sure of the Angle

RunService.RenderStepped:Connect(function()
	Part.Position = Character.Head.Position + Vector3.new(0,0,20) -- Sets Position
	TweenService:Create(Camera, TweenInfo.new(0.5), {CFrame = Part.CFrame}):Play()
end)

Character.Humanoid.Died:Connect(function()
	
	task.wait(game.Players.RespawnTime - 1)
	Part:Destroy()
end)

I don’t see the relevance of this question, you do not need to know another coding paradigm to be able to script a 2d camera

If you want to create a real 2D camera, you have to.
You have to simulate everything from physics to field of view in GUI and that requires some knowledge about OOP cus it helps a lot in that stuff…

what? OOP does not directly link to “physics” and no: sometimes OOP just makes code more complex than needed

I’m asking for a camera for a Gui, have you looked in the video? it’s completely in 2D

Can you just Center the Frame?

No, because there isn’t a 2D camera and that’s what i want to make :joy: