I want my fov to move back when tapping shift and i alredy got a shift to sprint script. can I mabye get some little help with the last part - where the camera zooms out. right now it just "teleports" back when you hit shift and i want a smoot animation. Can somebody help me tnx!
local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
UIS.InputBegan:connect(function(input)--When a player has pressed LeftShift it will play the animation and it will set the normal walking speed (16) to 35.
local CurrentTime = tick()
if input.KeyCode == Enum.KeyCode.LeftShift then
if humanoid.MoveDirection.Magnitude > 0 then
game.Workspace.Camera.FieldOfView = 90
Character.Humanoid.WalkSpeed = 25
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://5984168294'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
else
if humanoid.MoveDirection.Magnitude < 0 then
PlayAnim:Stop()
end
end
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
game.Workspace.Camera.FieldOfView = 70
Character.Humanoid.WalkSpeed = 9
PlayAnim:Stop()
end
end)

1 comment
Updated my answer for your comment. Hope that helps a little bit more.