Issues Ending Animation After Input Ended

I’ve run into an issue while trying to create a “parry” animation for my weapon; The user should be able to hold MouseButton2 to parry with the weapon and let go of it to stop parrying the weapon. It does work however if you try just clicking MouseButton2, instead of holding it for a longer duration, it doesn’t end the animation.

My Code:

elseif Alive and ActionName == Katana_P then
		if InputState == Enum.UserInputState.Begin and not Animating then
			Animating = true
			
			StopAnimating()
		
			ParryKatana:AdjustSpeed(1)
			ParryKatana:Play()
			ParryKatana.Stopped:Wait()
			IsParrying = true
			IdleParryKatana:Play()
			
		elseif InputState == Enum.UserInputState.End and IsParrying then
			IsParrying = false
			IdleParryKatana:Stop()
			IdleKatana:Play()
			
			Animating = false
		end

Other Notes:

  • Uses the Context Action Service
  • I checked using print statements and the UserInputState.End DOES fire even when you click quickly, but the animation still plays.
  • You can view the testing place Here (Equip it with the [1] key).