This code executes when the player holds down SHIFT:
anim:Play(1)
The priority of this animation is Movement, just like the jumping animation that is supposed to happen when you press Space. I’ve even tried making the jumping animation Action, and I’ve tried making this animation Idle, but to no avail.
The slow walking is from the Animate script, as well as the (janky, but that’s a problem for another day) jumping and falling animation. The running is executed from the script in the OP, and as you can see when the fade time finishes it overrides the jumping.
This is the script that houses the small excerpt from before:
local speed = 25
local norm_spd = 10
local ke_y = Enum.KeyCode.LeftShift
wait()
local hum = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
hum.WalkSpeed = norm_spd
local fovMax = { FieldOfView = 70 + (speed/5) }
local fovMin = { FieldOfView = 70 }
local thing = game.Workspace.CurrentCamera
local tween = game.TweenService:Create(thing, TweenInfo.new(0.4, Enum.EasingStyle.Sine), fovMax)
local tween2 = game.TweenService:Create(thing, TweenInfo.new(0.4, Enum.EasingStyle.Sine), fovMin)
local tween3 = game.TweenService:Create(hum, TweenInfo.new(1, Enum.EasingStyle.Cubic), { WalkSpeed = speed })
local tween4 = game.TweenService:Create(hum, TweenInfo.new(1, Enum.EasingStyle.Cubic), { WalkSpeed = norm_spd })
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, processed)
if processed then return end
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == ke_y then
tween3:Play()
anim = hum:LoadAnimation(script.run)
anim:Play(1)
tween3.Completed:Connect(function()
tween:Play()
end)
end
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == ke_y then
--game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = norm_spd
tween4:Play()
anim:Stop(1)
tween4.Completed:Connect(function()
tween2:Play()
end)
end
end)
help please.