local uis = game:GetService("UserInputService")
local zoom = 100
local fieldOfView = 9
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local runServ = game:GetService("RunService")
local camera = workspace.CurrentCamera
local isoCameraConnection
local function isometricCamera()
if isoCameraConnection then isoCameraConnection:Disconnect() end
isoCameraConnection = runServ.RenderStepped:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = fieldOfView
if player.Character and player.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
local function basicCamera()
--if isoCameraConnection then
-- isoCameraConnection:Disconnect()
-- isoCameraConnection = nil
--end
--camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = character.Humanoid
print(character.Humanod)
end
uis.InputBegan:Connect(function(input, chatting)
if chatting then return end -- if player is typing in chat this function will not run
if input.KeyCode == Enum.KeyCode.F then
isometricCamera()
elseif input.KeyCode == Enum.KeyCode.R then
basicCamera()
end
end)
I’m trying to make isometric camera back to normal camera but I don’t know how to do it, help please
Just wanted to clarify that we do disconnect events immediately when you call the disconnect method. It’s only in the case of destroying the object that we defer the disconnections (to ensure you get all of the events).
local uis = game:GetService("UserInputService")
local zoom = 100
local fieldOfView = 9
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local runServ = game:GetService("RunService")
local camera = workspace.CurrentCamera
local isoCameraConnection
local function isometricCamera()
if isoCameraConnection then isoCameraConnection:Disconnect() end
isoCameraConnection = runServ.RenderStepped:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = fieldOfView
if player.Character and player.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
local function basicCamera()
if isoCameraConnection then
isoCameraConnection:Disconnect()
isoCameraConnection = nil
end
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = character:FindFirstChild(“Humanoid”)
camera.FieldOfView = 90 -- standard
print(character:FindFirstChild(“Humanoid”))
end
uis.InputBegan:Connect(function(input, chatting)
if chatting then return end -- if player is typing in chat this function will not run
if input.KeyCode == Enum.KeyCode.F then
isometricCamera()
elseif input.KeyCode == Enum.KeyCode.R then
basicCamera()
end
end)
Not able to test this since I’m on phone, lmk if it works or not