Im trying to make a 2D style fighting game and i have the whole 2 players are in view of the camera, but how do i lock the position of the camera to a part while still being able to move slightly for movement?
while wait() do
if script.Parent.Play1.Value ~= "" and script.Parent.Play2.Value ~= "" then
local hrp1 = game.Players:WaitForChild(script.Parent.Play1.Value).Character:WaitForChild("UpperTorso")
local hrp2 = game.Players:WaitForChild(script.Parent.Play2.Value).Character:WaitForChild("UpperTorso")
local averagePosition = (hrp1.Position + hrp2.Position) / 2
local cameraPos = workspace.CurrentCamera.CFrame.p
workspace.CurrentCamera.CFrame = CFrame.lookAt(cameraPos, averagePosition)
end
end