Legends Improved First Person
Key RequiredUniversal

Legends Improved First Person

Universal Scripttheobscured102theobscured102 827 views 810 executesUpdated Apr 8, 2026
Unrated
00
Lua Script•78 lines (2384 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")

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

local OFFSET_FIRST_PERSON = Vector3.new(0, 0, -0.7)
local OFFSET_OTHER = Vector3.new(0, 0, 0)
local SWAY_LIMIT = 6
local FOV_ADD = 10

local function lerp(a, b, t)
	return a + (b - a) * t
end

local turn = 0
local cameraOffset = Vector3.new()
local defaultFOV = camera.FieldOfView

local function setupCharacter(char)
	local humanoid = char:WaitForChild("Humanoid")
	local head = char:WaitForChild("Head")

	for _, v in ipairs(char:GetChildren()) do
		if v:IsA("BasePart") and v.Name ~= "Head" then
			v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
				v.LocalTransparencyModifier = v.Transparency
			end)
			v.LocalTransparencyModifier = v.Transparency
		end
	end

	RunService:BindToRenderStep("CameraHandler", Enum.RenderPriority.Camera.Value + 1, function(deltaTime)
		if not char.Parent then return end

		local zoom = (camera.CFrame.Position - head.Position).Magnitude
		local firstPerson = zoom <= 1

		local targetOffset = firstPerson and OFFSET_FIRST_PERSON or OFFSET_OTHER
		humanoid.CameraOffset = humanoid.CameraOffset:Lerp(targetOffset, 5 * deltaTime)

		if firstPerson then
			local mouseDelta = UserInputService:GetMouseDelta()
			turn = lerp(turn, math.clamp(mouseDelta.X, -SWAY_LIMIT, SWAY_LIMIT), 6 * deltaTime)
			camera.CFrame = camera.CFrame * CFrame.Angles(0, 0, math.rad(turn))
		end

		local targetFOV = firstPerson and (defaultFOV + FOV_ADD) or defaultFOV
		camera.FieldOfView = lerp(camera.FieldOfView, targetFOV, 3 * deltaTime)
	end)
end

if player.Character then
	setupCharacter(player.Character)
end

player.CharacterAdded:Connect(function(char)
	RunService:UnbindFromRenderStep("CameraHandler")
	setupCharacter(char)
end)

StarterGui:SetCore("SendNotification", {
	Title = "Improved First Person";
	Text = "Improved first person script with fov and swaying camera effect.";
	Button1 = "Nice";
	Duration = math.huge;
})

task.delay(0.1, function()
	StarterGui:SetCore("SendNotification", {
		Title = "Script Made by Legend";
		Text = "Credits to the owners for the original scripts. Have fun.";
		Button1 = "Alright";
		Duration = math.huge;
	})
end)

Features & Information

My first person camera script. I kinda stole some camera scripts from the internet and improved it myself so... credits to the original creators of the scripts here! Also this is open source, just in case you want to add this in your own game.. or smth like that.

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts