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

How to make a top-down camera but the player can't move it?

I'm making a game where the camera is set to be top-down, I've made the script to make it top-down but I don't want the player to move it when walking. Any idea on how to fix this?

[local RunService = game:GetService("RunService")	
 
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
 
local CAMERA_OFFSET = Vector3.new(-1,90,0)
 
camera.CameraType = Enum.CameraType.Scriptable
 
local function onRenderStep()
	if player.Character then
		local playerPosition = player.Character.HumanoidRootPart.Position
		local cameraPosition = playerPosition + CAMERA_OFFSET
		
		camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
	end
end
 
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)

1 answer

Then don't update the camera at all

local RunService = game:GetService("RunService")   

local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer

local CAMERA_OFFSET = Vector3.new(-1,90,0)

task.wait()
camera.CameraType = Enum.CameraType.Scriptable

if player.Character then
	local playerPosition = player.Character.HumanoidRootPart.Position
	local cameraPosition = playerPosition + CAMERA_OFFSET

	camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
end

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