Why is the animation not playing?
So i have a script that is suppose to enable the player to slide, but the script is not playing the animation.
03 | local WalkToSlide = Instance.new( "Animation" ) |
06 | local SlideLoopAnimaion = Instance.new( "Animation" ) |
09 | local WalkToSlideAnimationTrack = Animator:LoadAnimation(WalkToSlide) |
10 | local SlideLoopAnimationTrack = Animator:LoadAnimation(SlideLoopAnimaion) |
14 | if _Delay then return end |
19 | WalkToSlideAnimationTrack:Play() |
20 | WalkToSlideAnimationTrack.Stopped:Connect( function () SlideLoopAnimaion:Play() end ) |
24 | local function StopSlide() |
25 | if Sliding then return end |
26 | if not _Delay then return end |
30 | if WalkToSlideAnimationTrack:IsPlaying() then WalkToSlideAnimationTrack:Stop() else SlideLoopAnimaion:Stop( 0.1 ) end |
33 | uis.InputBegan:Connect( function (Key) |
34 | if Key.KeyCode = = Enum.KeyCode.LeftShift then Slide() end |
37 | uis.InputEnded:Connect( function (Key) |
38 | if Key.KeyCode = = Enum.KeyCode.LeftShift then StopSlide() end |
I made a script in the past which worked but for some reason this script and the older script no longer works.
The script is located in StarterPlayer -> StarterPlayerScript.