Weapon Animation Resets Back From Where It Started

I am trying to make an animation for my weapon. This is a Hold position and as soon as the player equips the weapon, an animation should play.

Well, everything works fine but the problem is that the animation goes back the default animation as soon as I equip the weapon.
https://gyazo.com/c7db6fac214f844c813e46c7cfe92163
As you can see, as soon as I equip the weapon, the animation resets.
I want it so that the pistol stays in the same position (The Hold Position).

For your reference, I am following this tutorial from the DevForum:

This is my local script:

local Player = game.Players.LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local WeaponTool = script.Parent

local Humanoid = char:WaitForChild("Humanoid")

local Animation = script.Parent.Hold
local AnimationTrack = Humanoid:LoadAnimation(Animation)

script.Parent.Equipped:Connect(function()
	game.ReplicatedStorage.RemoteEvents.ConnectM6D:FireServer(WeaponTool.BodyAttach)
	char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
	char.UpperTorso.ToolGrip.Part1 = WeaponTool.BodyAttach
	AnimationTrack:Play()
	if AnimationTrack.IsPlaying then
		print("Playing animation track")
	end
end)

WeaponTool.Unequipped:Connect(function()
	game.ReplicatedStorage.RemoteEvents.DisconnectM6D:FireServer()
	AnimationTrack:Stop()
end)

It does print “Playing Animation Track”.

Is there any way to stop the animation from going back to the original position?
And another problem is that as you can see that the weapon comes from the torso. That doesn’t look good. Is there any way we can fix this?

Thanks for any help

I think that when you exported the animation, you forgot to set it’s Animation Priority.

What causes the bug, is that the priority of the normal character animations is now higher than your animation priority. Go into the animation editor and go in the same menu where you export it (the little drop-down menu). Then you select “Animation Priority” and change it to “Action”. Export your animation again and it should work.

I set the Animation Priority to Action but still it shows the same thing…:frowning:
https://gyazo.com/3f5037cd7c996f76a36a5021cb880444

This image is to show that I did set the animation priority to Action.
image
And I did export it again but still doesn’t work… :frowning:

This is the animation in the animation editor:

Can i ask why you are welding the gun? It should be done automatically when you’re making a tool.

Oh and, is looping enabled? It might just play the animation once and then stop.

I don’t have animation set to loop. Because if I will, the player will equip it again and again.
Like below:
https://gyazo.com/ad65b725efe60dc2da64120ddad5d739
As you can see, if I set it to loop, then the player equips the weapon again and again.
Please let me know if you have any fix for this as I really need to fix this issue.

1 Like

Then you should script it so you play the equip animation first, and then use the looped “holding” animation.