code is in local script within StarterGui; Filteringenabled is true
local debounce = false
local Player = game.Players.LocalPlayer
local camerabutton = game.Workspace.press4camera
local CAMERAPart = game.Workspace.CAMERAPart
local FOCUSPart = game.Workspace.FOCUSPart
local focusonobject = false
function checkplayer(otherpart)
local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
if humanoid then
return game.Players:GetPlayerFromCharacter(otherpart.Parent)
end
end
function playercam(otherpart)
if checkplayer(otherpart) == Player then
if debounce then
return
end
debounce = true
if focusonobject then
-- change camera back to default camera
wait()
else
wait()
-- camera would be affixed to object and focusing on an object to create isometric 3D perspective independent of player control
playercam = Player.PlayerScripts:WaitForChild("CameraScript")
wait()
cam.CameraType = "Watch"
cam.CameraSubject = FOCUSPart
cam.CoordinateFrame = CFrame.new(CAMERAPart.Position)
focusonobject = true
end
end
debounce = false
end
camerabutton.Touched:connect(playercam)
I'm having trouble with the player camera, I don't want the player to be able to move the camera once when the camera is focusing on an object. I want to make the camera focused on an object once the player steps on the button (player cannot move camera), and once the player steps on the button again, the camera returns to the default camera.
Thanks in advance!

4 comments
Changing the camera type to scriptable did work (the player can't move camera), now I don't know how to script the camera so that it's focusing on
cam.CameraSubject = FOCUSPart that part should have done that
/ cam.CameraSubject = FOCUSPart / did work when the camera type was "Watch", but now after it's "Scriptable", it's attached to CAMERAPart and looking forward because of / cam.CoordinateFrame = CFrame.new(CAMERAPart.Position) /
for clarity Camera is attached to CAMERAPart, but it's looking forward and not at FOCUSPart, and I don't know how to script it to focus on that object.