I’m trying to make a birds-eye view camera system and it’s working fine except that the camera is facing the wrong way.
The labels show which side is supposed to be the front, back, left, right of the game and I want the camera to be turned 90° counter clockwise but I’m not sure how to do that.
Here is the script:
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
camera.CameraType = Enum.CameraType.Scriptable
local targetDistance = 30
local cameraDistance = -30
local cameraDirection = Vector3.new(0, -1, 0)
local currentTarget = cameraDirection * targetDistance
local currentPosition = cameraDirection * cameraDistance
game:GetService("RunService").RenderStepped:connect(function()
local character = player.Character
if character and character:FindFirstChild("Humanoid") and character:FindFirstChild("HumanoidRootPart") then
local torso = character.HumanoidRootPart
camera.Focus = torso.CFrame
if torso:FindFirstChild("FastStart") == nil then
camera.CoordinateFrame = CFrame.new(torso.Position + Vector3.new(0, 3, 0) + currentPosition,
torso.Position + Vector3.new(0, 3, 0) + currentTarget)
else
camera.CoordinateFrame = CFrame.new(torso.Position + Vector3.new(0, -20, 0) + currentPosition,
torso.Position + Vector3.new(0, -20, 0) + currentTarget)
end
end
end)
How would I rotate the camera?