#Run animation not playing correctly

11 messages · Page 1 of 1 (latest)

ember crater
#
]]

-- // Get Player Stuff
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid", 3)
local IsSprinting = false
--/// Get Service
local Camera = game:GetService("Workspace").CurrentCamera
local ContextActionService = game:GetService("ContextActionService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")

-- // Settings
local SprintSpeed = 28 -- Sprinting Speed
local DefaultSpeed = 16 -- Default Speed
local SprintFOV = 90 -- Max: 120

--// Animations
local runAnim = script.Animation
local runTrack = Humanoid.Animator:LoadAnimation(runAnim)

--// Functions
local function SprintFov(Value : boolean)
    local Tweeninfo = TweenInfo.new(
        0.5,
        Enum.EasingStyle.Linear
    )
    if Value then
        TweenService:Create(Camera, Tweeninfo, {FieldOfView = SprintFOV}):Play()

    else
        TweenService:Create(Camera, Tweeninfo, {FieldOfView = 70}):Play()
    end
end

-- // Sets Player Speed When Its Holding Shift, Also Creates A Action For Mobile Players To Sprint.
ContextActionService:BindAction("Sprint", function(_, inputState)
    if inputState == Enum.UserInputState.Begin then
        Humanoid.WalkSpeed = SprintSpeed
        IsSprinting = true
    else
        Humanoid.WalkSpeed = DefaultSpeed
        IsSprinting = false
    end
end, true, Enum.KeyCode.LeftShift)
ContextActionService:SetTitle("Sprint","Sprint")
ContextActionService:SetPosition("Sprint", UDim2.new(1, -70, 0, 10))

-- // Main
RunService.RenderStepped:Connect(function() -- Loop Checks
    if IsSprinting and Humanoid.MoveDirection.Magnitude > 0 then
        SprintFov(true)
        runTrack:Play()
    else
        SprintFov(false)
        runTrack:Stop()
    end
end)```
near kayak
#

Animation duration?
Playback speed of the animation?
Animation looping?

By these I mean in the animation itself

#

@ember crater

ember crater
ember crater
#

I solved it now nvm. I just got a new script instead

gritty sentinel
#

my script?

#

where did you find that

#

.

pastel waspBOT
#

studio** You are now Level 7! **studio

gritty sentinel
#

i made that thing as a joke and ppl r using lmaoo