You can write your topic however you want, but you need to answer these questions:
I want to achieve something like this a camera system similar to Super Smash Bros or a tekken style camera
https://gyazo.com/0c09a1d3c08d0931cf4be9da8db4c4b2
But this is the issue?
https://gyazo.com/07b46953a11ae66731a3f05a2a24e69e
I tried look for solutions on the Developer Hub and devforms but I had no luck
P.S. the script is not mines its from @fipsii123
--//Services\\--
local RunService = game:GetService("RunService")
local TS = game:GetService("TweenService")
--//Variables\\--
local player = game.Players.LocalPlayer
local players = game:GetService("Players")
local char = player.Character or player.CharacterAdded:Wait()
local HRP = char:WaitForChild("HumanoidRootPart")
local positionvar = Vector3.new(0,0,0)
local xvalues = {}
local zoom = 55
local number
local camera = workspace.CurrentCamera
camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = 40
--//Functions\\--
local function UpdateCam()
--Get players
local playernum = game.Players:GetPlayers()
number = #playernum
-- Insert position in the table
for _, playername in pairs(players:GetPlayers()) do
if positionvar.X < 330 then
positionvar = positionvar + playername.Character.HumanoidRootPart.Position
table.insert(xvalues, playername.Character.HumanoidRootPart.Position.X)
-- If player is out of bounds ignore him by removing the position from the table and subtracting the total amount of players by 1
else
table.remove(xvalues, playername.Character.HumanoidRootPart.Position.X)
if number > 1 then
number = number - 1
end
end
end
-- Sort Table
table.sort(xvalues,
function(a,b)
return a > b
end)
-- calculate zoom and get camera position
if xvalues[number] ~= nil then
zoom = math.abs(xvalues[number] - xvalues[1]) * 1.25
-- calculate the camera position by taking the mean value of all the player positions
positionvar = positionvar/number
end
-- tween camera to the desired postition
if zoom < 55 then
local Tween = TS:Create(camera, TweenInfo.new(0.5), {CFrame = CFrame.new(positionvar) * CFrame.new(1,1,55)}):Play()
elseif zoom < 200 then
local Tween = TS:Create(camera, TweenInfo.new(0.5), {CFrame = CFrame.new(positionvar) * CFrame.new(1,1,zoom)}):Play()
end
-- reset
positionvar = Vector3.new(0,0,0)
xvalues = {}
end
--//Core\\--
-- Update the camera
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, UpdateCam)