Animations priorities problem

I got sprinting system with animation included.
While sprinting, animation with Idle priority starts playing (with AnimationTrack.IsPlaying check).

If sprinting:

if not sprintAnimation.IsPlaying then
	sprintAnimation:AdjustWeight(0.8)
	sprintAnimation:Play(0.2)
end

Else:

if sprintAnimation.IsPlaying then
	sprintAnimation:Stop(0.1)
end

Jump animation’s priority is set to Movement (fall’s too).

If sprinting animation’s priority is set to Core, then, after jumping, sprinting animation just stops.

I tried mixing priorities so they work together, but it didn’t work.
Any help?

  1. Set running and falling to movement,

  2. Set jump to action,

  3. and set idle to idle.

    I apologize if this doesn’t work, I had trouble understanding the issue as described.

1 Like

Oh, sorry. I already solved this problem. Forgot to put a solution here.

Basically what am I doing, is checking if player has jumped and stuff:

-- humanoid statechanged is working too, but this is just an example
runService.RenderStepped:Connect(function()
	if humanoid:GetState() == Enum.HumanoidStateType.Jumping or humanoid:GetState() == Enum.HumanoidStateType.FallingDown or humanoid:GetState() == Enum.HumanoidStateType.Freefall or humanoid:GetState() == Enum.HumanoidStateType.Flying or humanoid:GetState() == Enum.HumanoidStateType.Climbing then
		midAir = true
	else
		midAir = false
	end
end)
if not sprintAnimation.IsPlaying and not midAir then
	sprintAnimation:AdjustWeight(6)
	sprintAnimation:Play(0.4)
elseif sprintAnimation.IsPlaying and midAir then
	sprintAnimation:Stop(0.1)
end