Sprint animation merging with walk animation

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I would like to have the sprint animation not merge with the walk animation

  2. What is the issue? Include screenshots/videos if possible!
    The sprint animation is merging with the walk animation making the animation look weird.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried looking for solutions on the developer hub but didn’t succeed.

This is my script

-- Services
local inputService = game:GetService("UserInputService")
local playerService = game:GetService("Players")

local DefaultFoV = 70
local TS = game:GetService("TweenService")

local Properties = {FieldOfView = DefaultFoV + 17.5}
-- Objects
local plr = playerService.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local settingsDir = script.Settings

local Properties2 = {FieldOfView = DefaultFoV}
local Info = TweenInfo.new(0.25, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera, Info, Properties)
local T2 = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera, Info, Properties2)
local anim = script.Settings.Animation
local animation = char:WaitForChild("Humanoid"):LoadAnimation(anim)

function getSetting (name)
	return settingsDir and settingsDir:FindFirstChild(name) and settingsDir[name].Value
end

local sprinting = false

inputService.InputBegan:Connect(function (key)
	if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
		running = true
		print("STARTED")
		if char:FindFirstChild("Humanoid") then	
			char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + ((plr.Stats.Agility.Value/448)*2)
			T:Play()
			animation:Play()
			game.ReplicatedStorage.SprintEvent:FireServer(true)
		end
	end
end)

inputService.InputEnded:Connect(function (key)
	if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
		running = false
		print("ENDED")
		if char:FindFirstChild("Humanoid") then	
			char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + (plr.Stats.Agility.Value/448)
			T2:Play()
			animation:Stop()
			game.ReplicatedStorage.SprintEvent:FireServer(false)
		end
	end
end)

TY! :smiley: