AnimationTrack Priority and Weight Not Set

I am currently working to fix an animation while flying. While walking on the ground, all animations work perfectly fine, but in this game you can fly, and while flying most animations work fine except one particular attack animation.

I have tried setting the priority and weight of the animation via script before playing it, but printing AnimationTract.Priority returns nil, even after setting it to Enum.AnimationPriority.Action. Printing AnimationTrack.WeightCurrent constantly returns zero even if AnimationTrack.WeightTarget is not zero.

My current code for creating and playing the attack animation looks like:

local AnimationTrack = Humanoid:LoadAnimation(Value.Animation)
AnimationTrack.Priority = Enum.AnimationPriority.Action
print(AnimationTrack)
print(AnimationTrack.Priority)
AnimationTrack:Play()

I have tried setting the attack animation to an action, setting the flying animation as low as idle, but neither of those solve my issue. Like I said, weight is refusing to change so that is helping me none.

All of the animation is being done from a Script on the server side, and I don’t currently have access to the animations themselves. Any pointers or tips would be greatly appreciated.

This could be the problem.

Humanoid:LoadAnimation() is deprecated, use Animator:LoadAnimation() instead. This is a child that’s added inside a player’s humanoid. If you’re using it on a NPC, you must add a Animator Instance manually in the NPC’s humanoid.

I did that, both with the flight script animations and the combat script. It did not improve the situation. It is almost like the animation played while flying is a completely separate animation from when the character is walking.