Animation Replication Issues

Hello everyone, this is a followup post to yesterday’s post reagrding the same issue, but i will go into more detail here, appolagies for being so vague in my last post it was rather late for me.

So, The issue is that the animations for one of my creatures are not replicating to the server. The code used to animate this creature is the same as I use for every other creature. This is the only creature with this problem.

Things ive tried:

  • Reuploading the animations

  • Loading the animations the line before they’ll be played

  • Running the animations on a differant local script (to check if they’ll play at all)

Gif: https://gyazo.com/4f341e43d644c7ad73f23df10d5407e8

(Tail drag is done locally, that is meant to not replicate)

Code:

local char = game.Players.LocalPlayer.Character
local currentAnim = "Idle"
local humanoid = char:WaitForChild("Humanoid")


Idle = humanoid:LoadAnimation(script.Parent.Parent.Info.Animations.Movement.Idle)

Walk = humanoid:LoadAnimation(script.Parent.Parent.Info.Animations.Movement.Walk)

local function stopAnimations()
	
	Idle:Stop(char.Info.Animations.Movement.TransitionTimes.WalkTransition.Value)
	Walk:Stop(char.Info.Animations.Movement.TransitionTimes.WalkTransition.Value)
	
end


function charMoving(speed)
	
	if speed > char.Info.Stats.Movement.WalkSpeed.Value / 1.5 and currentAnim ~= "Walk" then
		currentAnim = "Walk"
		stopAnimations()
		Walk:Play(char.Info.Animations.Movement.TransitionTimes.WalkTransition.Value)

	elseif speed < 2 and currentAnim ~= "Idle" then
		currentAnim = "Idle"
		stopAnimations()
		Idle:Play(char.Info.Animations.Movement.TransitionTimes.WalkTransition.Value)
	end

end

Idle:Play()
humanoid.Running:Connect(charMoving)
	
game:GetService("RunService").Heartbeat:Connect(function()

	if (humanoid.MoveDirection:Dot(char.PrimaryPart.CFrame.LookVector) < 0) then
		Walk:AdjustSpeed(-1)
	end

	if (humanoid.MoveDirection:Dot(char.PrimaryPart.CFrame.LookVector) > 0) then
		Walk:AdjustSpeed(1)
	end

end)

Ive been struggling with this bug for three days now and cant figure out the cause since the code works on every other creature!

Firstly I would switch from Humanoid to Humanoid.Animator.
Humanoid:LoadAnimation is currently deprecated and a new object called Animator that is a child of Humanoid took its place.

The function name is the same so Humanoid.Animator:LoadAnimation should work.

If the fact that Humanoid:LoadAnimation is deprecated is causing this issue then switching to Humanoid.Animator should work.

1 Like

Yes this fixed it! Thank you so much!!

1 Like