So i have an isometric camera script but it seems to not work when im behing objects, the raycast doesnt detect objects when im still and my camera jumps everywhere
local zoom = script:GetAttribute('Zoom')
local FOV = script:GetAttribute("FOV")
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local HighLight = Character:WaitForChild("Torso"):WaitForChild("Highlight")
local HumanoidRoot = Character:WaitForChild("HumanoidRootPart")
Camera.CameraType = Enum.CameraType.Custom
local RunService = game:GetService("RunService")
local RayParams = RaycastParams.new()
RayParams.FilterDescendantsInstances = {Character}
RayParams.FilterType = Enum.RaycastFilterType.Exclude
local function createDebugRay(startPos, endPos)
local distance = (endPos - startPos).Magnitude
local part = Instance.new("Part")
part.Anchored = true
part.CanCollide = false
part.CanQuery = false
part.Material = Enum.Material.Neon
part.Color = Color3.fromRGB(0, 255, 0)
part.Size = Vector3.new(0.05, 0.05, distance)
part.CFrame = CFrame.new(startPos, endPos) * CFrame.new(0, 0, -distance / 2)
part.Parent = workspace
game.Debris:AddItem(part, 6)
end
local normalFov = Camera.FieldOfView
local icoEnabled = false
UIS.InputBegan:Connect(function(inpt,gm)
if inpt.KeyCode == Enum.KeyCode.V then
icoEnabled = not icoEnabled
Camera.FieldOfView = normalFov
end
end)