Hey, I'm making a 2D shared camera script (think street fighter), and I've already found a way to keep the camera in the middle of two players, by finding the midpoint of both players. The problem is that the camera wont stay at a side view. I figured that if I rotate the part in the center of both players, the camera would also rotate, however I'm not too sure. Could someone point me in the right direction?
repeat wait() until _G.arbDistance and _G.torsoDir
_G.side = "left"
local plr = game:GetService("Players").LocalPlayer
local RunService = game:GetService('RunService')
_G.camera = game.Workspace.CurrentCamera
_G.camera.CameraType = "Scriptable"
_G.mpPart = Instance.new("Part", workspace)
_G.mpPart.Name = plr.Name .. "'s Camera"
_G.mpPart.Size = Vector3.new(0.2, 0.2, 0.2)
_G.mpPart.Shape = "Ball"
_G.mpPart.Transparency = 1
_G.mpPart.CanCollide = false
_G.mpPart.Anchored = true -- Physics shouldn't be acting on this part
local zoom = 30
local height = 2
local angle = 0
local lv = _G.mpPart.CFrame.lookVector
local rv = _G.mpPart.CFrame.rightVector
function update()
if plr.Character and plr.Character:FindFirstChild('Torso') then
_G.mp = CFrame.new(_G.c1:Lerp(_G.c2, .5))
_G.mpPart.CFrame = CFrame.new(0, 2, 0) * _G.mp
_G.camera.CameraSubject = _G.mpPart
_G.camera.CoordinateFrame = CFrame.new(_G.mpPart.Position)
* CFrame.new(0, height, zoom)
* CFrame.Angles(0, 0, 0)
end
end
RunService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, update)

3 comments
================>
Remember that each player will have their own version of _G.camera. If I am not mistaken, each instance of this local script will overwrite the other's.
game.Workspace.CurrentCamera is the camera for that specific player. Try having a different variable name for each player, like so: _G[plr.Name .. "Camera"] = game.Workspace.CurrentCamera.