Hold an animation pose

I was wondering how I can hold the position of an animation at a certain time. For example I have animation that will take a bat and do an animation in front of the character, but the player will just go back to the original tool pose position.

If anyone has an idea on how to do this it would be appreciated

Pause the animation by doing (Animation_Name):AdjustSpeed(0)

Ive already tried but to no avail.

tool.Equipped:Connect(function()
	local char = tool.Parent
	local anim = script:WaitForChild("equip")
	local hum = char.Humanoid

	local equip = hum:LoadAnimation(anim)
	equip:Play()
	
	equip.Stopped:Connect(function()
		equip:AdjustSpeed(0)
	end)
end)

This did not work :frowning:

pretty sure you could delete the “equip.Stopped” and just add a delay/wait to your desired waiting time then Adjust the speed to 0

2 Likes

yeah i got it work thanks!

tool.Equipped:Connect(function()
	local char = tool.Parent
	local anim = script:WaitForChild("equip")
	local hum = char.Humanoid

	local equip = hum:LoadAnimation(anim)
	equip:Play()
	
	task.wait(0.6)
	
	equip:AdjustSpeed(0)
end)
3 Likes

Oh no I found another problem lol. Now when I unequip the bat the hands stay in the same position

Inside of Tool.Unequipped I would get all playing animation tracks from the humanoid and find the name of the specific anim to stop it.

Sorry I am new to scripting animations, how would I check to see if the humanoid is playing a certain animation?

tool.Unequipped:Connect(function()
for i,Animation in pairs(hum:GetPlayingAnimationTracks()) do
if Animation.Name == (The Animations Name) then
Animation:Stop()
end
end
end)

actually the best thanks bro

tool.Unequipped:Connect(function()
	local char = workspace:FindFirstChild(plr.Name)
	local hum = char.Humanoid
	
	for i, v in pairs(hum:GetPlayingAnimationTracks()) do
		if v.Name == "equip" then
			v:Stop()
		end
	end
end)
1 Like