Need Help With Disabling Camera Movement

Hello! So I made An Isometric Camera that works just fine, except that you can move around the camera.


as you can see, it works fine, but i can still move around my camera. I’d like to make it so that you can’t move around the camera, like in the first couple seconds of the video, if that makes any sense. Basically i just need to disable the camera movement made by players, but i’m not sure how. I’ve tried looking it up but nothing appears.

Any Help is appreciated. Thank you!

1 Like

Set the CameraType To Scriptable

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

do i make a new localscript with that code in it and put it in startercharacterscripts? Sorry i’m not the best at scripting

you can do a min zoom in and out

Just paste it somewhere where you did your camera behaviour, prefarably somewhere at the top of the script

the zoom is fine, you cant zoom in or out, but i just need help making it so that you cant rotate your camera

when i put it in my script, it totally broke the camera and it’s just stuck zoomed in to the spawn point.

you have to make it so that the camera’s position always stays on ur character

im not really sure how to script that

Oh yea, cause you need to follow the movement of the player, you can use RunService to achieve that (I will post a script later)

Thank you, i can post the script that i made to see if it would help :slight_smile:

local zoom = 500
local FieldOfView = 7

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = game.Workspace.CurrentCamera

Camera.CameraType = Enum.CameraType.Custom

local RunService = game:GetService(“RunService”)
RunService.RenderStepped:Connect(function()
Camera.FieldOfView = FieldOfView
if Character then
if Character:FindFirstChild(“Head”) then
game:GetService(“SoundService”):SetListener(Enum,ListenerType.ObjectCFrame, Character.Head)
Camera.CFrame =
CFrame.new(Vector3.new(Character.Head.Position.X + zoom, Character.Head.Position.Y + zoom, Character.Head.Position.Z + zoom), Character.Head.Position)
end
end
end)

-- Place this script in StarterPlayer > StarterPlayerScripts

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

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

local sensitivity = 0.1  -- Adjust the sensitivity to your preference

local function onRenderStep()
    local mouseDelta = player:GetMouse().Delta
    local rotateY = CFrame.Angles(0, math.rad(-mouseDelta.x * sensitivity), 0)
    local rotateX = CFrame.Angles(math.rad(-mouseDelta.y * sensitivity), 0, 0)

    camera.CFrame = camera.CFrame * rotateX * rotateY
end

RunService.RenderStepped:Connect(onRenderStep)

it doesnt seem to be working for some reason. I put the script in a local script inside of starterplayerscripts but i can still move my camera normally

I know this i dont i know why do reson post script

If your isometric camera otherwise works as you’d like, do remember that if you name the LocalScript containing its code to CameraScript and place it inside StarterPlayerScripts, it would allow you to disable the default camera logic which will prevent players from rotating or zooming the camera

That will camera movements zoom

This should do the trick

local RunService = game:GetService("RunService")

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")


local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

local StationaryCam = Instance.new("Part")
StationaryCam.Name = "StationaryCam"
StationaryCam.Anchored = true
StationaryCam.CanCollide = false
StationaryCam.Transparency = 1
StationaryCam.Parent = character:WaitForChild("HumanoidRootPart")

RunService.RenderStepped:Connect(function()
	StationaryCam.Position = HumanoidRootPart.Position
	camera.CFrame = StationaryCam.CFrame * CFrame.new(0, 5, 10) * CFrame.Angles(math.rad(-20), 0, 0)
	-- customise this however you want
end)

If I understand you correctly, then yes it would also disable the ability for players to zoom the camera unfortunately so OP will need to add it back to their camera system if they wish

when i did that it stopped working. Right now it’s in startercharacterscripts named CameraScript, but when i put it into starterplayer scripts it stopped working

Yeah they will better away think about

1 Like