Issue with getting a specific animation that is playing

I’m making a module and I’m trying to get a specific animation playing on the animator with a specific name, but I’m not sure how to do it! My current code right now is

function module.ChangeAnimSpeed(anim, animator, speed)
	local animations = animator:GetPlayingAnimationTracks()
	local animation
	
	if animations[anim] then
		animation = animations[anim]
	end
	
	if animation then
		warn("Successfully found "..anim.." playing on the animator! Changin speed.")
		animation:AdjustSpeed(speed)
	else
		warn("No animation with the name "..anim.." found playing on the animator.")
	end
end

Currently what it’s outputing is the one saying that there is no animation with the specific name… any help would be appreciated!

I’m not seeing how an animation is being defined here. I don’t see an id or a path to an animation value

I’ve managed how to do this, I just created a table instead of doing :GetPlayingAnimationTracks().

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.