Animation will play but does not stop or go back to roblox default animation

does anyone know how i cna make my animation go back to roblox default after stopping the animation?

1 Like

Provide information first, then we can help.

I would use something like this to stop it:

for i, track in pairs(Tracks) do
	track:AdjustSpeed(0)
end

And to restart it I would do this:

for i, track in pairs(Tracks) do
	track:AdjustSpeed(1)
end
1 Like

what else information is there to provide. i have an animation track instanced. loading the track onto humanoid. playing the animation track through keybind. animation track doesn’t stop when i put in stop.
and roblox default animation doesn’t come back.

why not track:Stop()?
sdgdfgsdfgsdfgsdfgsdfgfdg

I’m not sure but changing the speed has always worked for me in my scripts.

and so your roblox default animations come back after your animation has played?

Is the track looped? You can use AdjustWeight to force it to stop.

I have used this in the past even to stop roblox animations and then continue them.

i have not set the loop properties. so whatever the default is

Try AdjustWeight(0) instead of Stop.

well it did change the behavior a bit. but still no good. but i also modified the way the code was structured and added a connection.

local function onInputBegan(input, gameProcessedEvent)
	local proneIdleAnim = character:WaitForChild("Humanoid"):LoadAnimation(idleAnim)
	local proneMovingAnim = character:WaitForChild("Humanoid"):LoadAnimation(movingAnim)
	
	if gameProcessedEvent then
		return
	else
		if input.KeyCode == Enum.KeyCode[keybind] then

			if isProned then
				connection:Disconnect()
				character.Humanoid.WalkSpeed = 16
				isProned = false
				character.HumanoidRootPart.CanCollide = true
				
				proneIdleAnim:AdjustWeight(0)
				proneMovingAnim:AdjustWeight(0)
			else
				character.Humanoid.WalkSpeed = PRONE_SPEED
				isProned = true
				character.HumanoidRootPart.CanCollide = false
				
				connection = player.Character.Humanoid.Running:Connect(function(speed)
					if speed > 0 then
						isMoving = true
						proneMovingAnim:Play()
						proneIdleAnim:AdjustWeight(0)
					else
						isMoving = false
						proneIdleAnim:Play()
						proneMovingAnim:AdjustWeight(0)
					end
				end)
			end
		end
	end
end
1 Like

You need to detect if it’s playing before you play it. If you play it twice it will overlap I believe.

detect if playing? through debounce? i don’t see a need for that though if i turn it on and off properly right? [UPDATE] i see what you mean now

You should use AnimationTrack.IsPlaying and if it’s already playing, don’t play it again.

1 Like

so when i checked if playing it doesn’t play it now. which doesn’t make sense to me because it’s not playing lol. god animation bro. i’ve used animations in tools before and they’ve always worked how they should. this is a local script

Are you adjusting the speed to 0 instead of stopping it? This method will only work if you use Stop.

the last bit of code is what i have except i hadded the .Playing which makes it not work at all.

It’s not that, it’s IsPlaying. I think Playing is a different property.

oh okay. well i’m going to test. um. i’m thinking of like maybe it has to do with me loading animations onto humanoid but i really have no idea.