My animations on the server and client dont match up

I was trying to change the idle and walking animations, but the server doesn’t match up with the client. Maybe it’s because the way I’m trying to change the animations is wrong?
image
image

	local animate = lp.Character.Animate
	for _, anim in folder:GetChildren() do
		local animParent = animate:FindFirstChild(anim.Name)
		if #animParent:GetChildren() == 1 then
			local oldAnim = animParent:FindFirstChild(anim.Name:sub(1,1):upper()..anim.Name:sub(2).."Anim")
			oldAnim.AnimationId = anim.AnimationId
		else
			local oldAnim = animParent:FindFirstChild("Animation1")
			oldAnim.AnimationId = anim.AnimationId
		end
	end
	for _, anim in lp.Character.Humanoid:GetPlayingAnimationTracks() do
		anim:Stop()
	end
	lp.Character.Animate.Enabled = false
	lp.Character.Animate.Enabled = true

This basically sets the animate.idle.Animation1 or whatever and then makes the animate script run again. Does anybody have a fix?

2 Likes

You need to load the animation on server first. Try loading the animation in a dummy when the server starts.

it didn’t work :sob:

for _, child in game.ReplicatedStorage.anims:GetDescendants() do
	if child:IsA("Animation") then
		workspace.Rig.Humanoid:LoadAnimation(child)
	end
end
1 Like

nevermind when I play them all at the same time it works, thanks!

I ran it again and it doesn’t work whoops

Load and play, sorry for the mistake

It still doesn’t work except for when I wait like 30 seconds and then play it

image
heres my rig doing every anim

are u trying to change the default animations of the player?

yea like when someone has an ak their idle and walk r different

it just sounds hacky to play the animations myself but I guess what I’m doing with the animate script is hacky

1 Like

Take a look at this page:

Yea I pretty much have the same thing going on, but that doesn’t cover changing core animations

1 Like

I just sent a remote to the server which stopped the anims and then the server switches the animate script on and off and we r good

2 Likes

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