--Get service needed for events used in this script
local RunService = game:GetService("RunService")
-- Variables for the camera and player
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
player.CharacterAdded:Wait()
-- Constant variable used to set the camera’s offset from the player
local CAMERA_OFFSET = player.Character:WaitForChild("CameraOffset").Value
camera.CameraType = Enum.CameraType.Scriptable
print(camera.CameraType)
local debounce = false
local function onRenderStep()
if debounce == false then
debounce = true
if player.Character then
if camera.CameraType == Enum.CameraType.Scriptable then
print("e")
local CAMERA_OFFSET = player.Character:WaitForChild("CameraOffset").Value
local playerPosition = player.Character.Torso.Position
local cameraPosition = playerPosition + CAMERA_OFFSET
-- make the camera follow the player
camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
end
end
debounce = false
end
end
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)
The result:
The camera faces left to right, instead of back to front like I want it to, how can I do that?