Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Rotating camera after disabling the camera?

So I've disabled camera usage in my game, but I still want them to be able to zoom in and out and rotate their camera, I don't know if this is possible and I couldn't find any tutorials. Can anyone help?

This is my script:

local offset = Vector3.new(-5,50,0)
local fieldOfView = 50
local player = script.Parent.Parent
local camera = game.Workspace.CurrentCamera
local runService = game:GetService("RunService")

camera.FieldOfView = fieldOfView
local function onRenderStep()
	local playerPosition = player.Character.HumanoidRootPart.Position
	local cameraPosition = playerPosition + offset
	camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
end
runService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)

1 answer

You put yourself to a lot of trouble, you should've just changed the CameraSubject

camera.CameraSubject = "what you want the subject to be e.g. game.Workspace.Part"

1 comment

0

Oops, I didn't seem to specify enough, I mean I want them to be able to only move their camera on the X axis and not the Y axis and also be able to zoom in and out.

This discussion is preserved as it was. New answers, comments, and votes are closed.