Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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.


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

✓ Accepted answer

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"

2 comments

0

hopefully you read this

0

thanks! The "rbxassetid://"..6467630387 method that i used seemed to work the last time i used it, But im guessing something changed. . .

This discussion is preserved as it was. New answers, comments, and votes are closed.