Thank you for looking at my question, I'll get right into the coding error I've encountered.

How I Encountered My Code Problem

After my PC being down for ages, I've been trying to get into the swing of things again by coding from the Roblox wiki page and I'm practicing a camera script, which follows the player's torso at all times. The camera script works fine, allowing for the ASDW controls to move without question, however for other players that prefer the arrow controls, it does not work for some reason, the arrow controls only move and access the camera, trying to turn the camera instead of the player. I labeled the variables to help people that are confused from my coding.

My Code For The Camera

local OS = Vector3.new(40,40,40)--Stands for OffSet
local FOV = 30--Stands for Field Of View

local player = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera--Stands for Camera
local runService = game:GetService('RunService')


cam.FieldOfView = FOV


local function onRenderStep()
	local playerPosition = player.Character.Torso.Position
	local cameraPosition = playerPosition + OS
	cam.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)

end

runService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onRenderStep)

So...

If you can help me solve this weird error, then I appreciate the help. Thank you for looking at my question, have a good day!

1 comment

0

I'm pretty certain that's just standard ROBLOX controls, using the left and right arrows has always rotated the camera.