Animation won't Stop

hum.StateChanged:Connect(function(old, newstate)
	if newstate == Enum.HumanoidStateType.Jumping then
		print("jumped")
		jumpstart:Play(0,1,.5)
		running:Stop()
		justjumped = true
	elseif newstate == Enum.HumanoidStateType.Freefall then
		jump:Play(0,1,.25)
	
	elseif newstate == Enum.HumanoidStateType.Landed and old == Enum.HumanoidStateType.Freefall  then
		print("Landed")
		jumpend:Play(0,1,.5)
		jump:Stop()
		if equipped then 
			idle:Play(0,1,0.25)
		else
			idlenoweapon:Play(0,1,0.25)
		end
		wait()
		justjumped = false
	end
end)

everything works perfectly except jump which doesn’t stop even though Landed prints so i know that code is running, any help is appreciated.

2 Likes

I think animation are sometimes bugged, maybe make a check if the IdleAnimation is playing (Also change “whateveryouwrotetoplayidleanimnation”):

wait()
if whateveryouwrotetoplayidleanimnation.IsPlaying then
	justjumped = false
end

justjumped has no relevance here its used somewhere else in the code. However u gave me an idea where i replaced

jump:Stop()

with

jump:Stop()
print(jump.IsPlaying)

it prints false but i can see the animation play ???

the problem was with jumpend animation which is supposed to play when the player lands, it was playing but it just doesn’t stop despite not being looped. it was Bugged, i created a new animation and replaced it now it works well

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.