Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the animation not playing?

Asked by
valk_3D 140
3 years ago

So i have a script that is suppose to enable the player to slide, but the script is not playing the animation.


local Sliding = false local WalkToSlide = Instance.new("Animation") WalkToSlide.AnimationId = "rbxassetid://"..6467630387 local SlideLoopAnimaion = Instance.new("Animation") SlideLoopAnimaion.AnimationId = "rbxassetid://"..6789330585 local WalkToSlideAnimationTrack = Animator:LoadAnimation(WalkToSlide) local SlideLoopAnimationTrack = Animator:LoadAnimation(SlideLoopAnimaion) --#Start sliding local function Slide() if _Delay then return end Sliding = true --_Delay = true WalkToSlideAnimationTrack:Play() WalkToSlideAnimationTrack.Stopped:Connect(function() SlideLoopAnimaion:Play() end) end --#Stop sliding local function StopSlide() if Sliding then return end if not _Delay then return end Sliding = false if WalkToSlideAnimationTrack:IsPlaying() then WalkToSlideAnimationTrack:Stop() else SlideLoopAnimaion:Stop(0.1) end end uis.InputBegan:Connect(function(Key) if Key.KeyCode == Enum.KeyCode.LeftShift then Slide() end end) uis.InputEnded:Connect(function(Key) if Key.KeyCode == Enum.KeyCode.LeftShift then StopSlide() end 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.

1 answer

Log in to vote
1
Answered by
1JBird1 64
3 years ago
Edited 3 years ago

I think I the problem is that on line 7 you do:

SlideLoopAnimaion.AnimationId = "rbxassetid://"..6789330585

Which instead what you should be doing is:

SlideLoopAnimation.AnimationId = "rbxassetid://6789330585"

There was also a spelling mistake

SlideLoopAnimaion.AnimationId

No L in the Animaion in the SlideLoopAnimaion

unless there isn’t supposed to be an L

Make sure to do the same to line 4

From:

WalkToSlide.AnimationId = "rbxassetid://"..6467630387

To:

WalkToSlide.AnimationId = "rbxassetid://6467630387"
0
hopefully you read this 1JBird1 64 — 3y
0
thanks! The "rbxassetid://"..6467630387 method that i used seemed to work the last time i used it, But im guessing something changed. . . valk_3D 140 — 3y
Ad

Answer this question