I have this script for a side scroller that lets the player move right
local cameraHeight = 12
local cameraZOffset = 20
local cameraXChase = 10
local cameraSpeed = .25
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')
local function setupCamera()
camera.CoordinateFrame = CFrame.new(Vector3.new(0,cameraHeight,cameraZOffset),
Vector3.new(0,cameraHeight,0))
end
setupCamera()
player.CharacterAdded:connect(setupCamera)
local function onUpdate()
if player.Character and player.Character:FindFirstChild('Torso') then
local playerX = player.Character.Torso.Position.X
local cameraX = camera.CoordinateFrame.p.X
if cameraX - cameraXChase < playerX then
camera.CoordinateFrame = camera.CoordinateFrame + Vector3.new(cameraSpeed, 0, 0)
end
end
end
RunService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onUpdate)
The only problem is that it dosnt let the player go left. How do I fix that?

3 comments
Where in your code does it move the player to the left??
it dosnt "let" the move to the left, the player can already move tot he left as they please, but the camera will only follow them left. It just sorta stays dormant when they go to the right
oh