Deprecating LoadAnimation on Humanoid and AnimationController

I thought you were going to deprecate animation controller I was about to get upset because it’s quite useful for rigs that you don’t want to have humanoid properties like health.

what? This works fine and it’s better?

1 Like

I’m having issues with this approach, I’ve tried calling this func provided here:

local function playAnimationFromServer(plr, character, animation)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if humanoid then
		-- need to use animation object for server access
		local animator = humanoid:FindFirstChildOfClass("Animator")
		if animator then
			local animationTrack = animator:LoadAnimation(animation)
			animationTrack.Looped = true
			animationTrack.Priority = Enum.AnimationPriority.Action
			animationTrack:Play()
			print(animationTrack.IsPlaying)
			return animationTrack
		end
	end
end

When I try calling it directly on the client (instanced an Animator into players humanoid on PlayerAdded) the function prints true and returns the name of the track. On the server it also prints true but the track name does not seem to return/replicate to the client ( ‘-’ in output ).

Here’s the local-side code

local function onEquipped()
	if currentlyPlaying == nil then
		currentlyPlaying = true

		-- Play equip animation

		-- Play idle animation
		playAnimationFromServer(plr.Character, idle_Anim)
		print(playAnimationFromServer(plr.Character, idle_Anim))
		--animateEvt:FireServer(plr.Character, idle_Anim)
		--print(animateEvt:FireServer(plr.Character, idle_Anim))
	end
end

What am I doing wrong?

great got to change a lot of my scripts but it would probably be better i knew this would come


:sad:

2 Likes

I really wish Humanoid:LoadAnimation wasn’t deprecated. It was so much more convenient to quickly get an animation to work. And now I more lines of code just to create, find, and sometimes check for the animator object just to play an animation. Other than that, glad replication issues has been fixed

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