Animation plays on client but not server, Animation not replicating

I have a default R15 Animate LocalScript with a custom run animation.

The run animation looks fine for your own character, but doesn’t replicate to where other players can see the animation.
https://i.gyazo.com/0c3f9ff31772422b793c80331b0dc766.mp4

I’ve tried everything, but I can’t get this animation to replicate to the server from the client side.

Things I’ve tried:

  • Editing the Animate LocalScript so that a server-created Animation object is used for the run animation (Instead of having the LocalScript create a new Animation object on the client side).

  • Making sure the client has NetworkOwnership over the body parts.

  • Setting the run animations priority to the highest setting.

Other details:

  • The custom run animation ID is owned by the group that the game is under.
  • I’m using an R15 rig with custom armor parts
  • None of the body parts are anchored

It feels like the universe has conspired against me. Advice would be appreciated.

1 Like

This is a bit odd, the only thing I can think of is that the other player’s character has something anchored. Are any of the parts that are used for the character anchored?

This doesn’t make much sense, but it’s the only thing I can think of regarding animations not playing, assuming they were implemented properly.

1 Like

None of the body parts are anchored.
I’ll add that detail to the OP.

I don’t get any errors when setting the Network Ownership either.

1 Like

Very weird, um I’ll try to right a piece of code I would do for sprinting script and you can maybe look over and see if you might of missed anything out of usual in your script, if you can’t then it is something probably with the custom model
Local Script

local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local uis = game:GetService("UserInputService")
local Animation = script.Animation -- Where my animation object is
local AnimationLoad = humanoid:LoadAnimation(Animation)
uis.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.W and W <= 2   then
		W = W + 1
		delay(0.5, function()
			W = 0
		end)
end
	if W == 2 then
			    if Input.KeyCode == (Enum.KeyCode.A)or (Enum.KeyCode.W)or(Enum.KeyCode.S)or (Enum.KeyCode.D) then

				
	humanoid.WalkSpeed = 24
	AnimationObject:Play()
		
		end 
	end
end)

Out of curiosity, does the custom rig use a humanoid object? And is the players character set to that specific rig?

@StraightScared
Thanks for the advice and taking your time to write that code.
Unfortunately this code is not optimal for the situation either.
For one thing, it would be better to use a combination of InputBegan and InputEnded.
Also, if I wanted the server to make the character walk to a position using Humanoid.WalkToPoint then there wouldn’t be any UserInputs and the animation would not play.

This code does something very similar:

Humanoid = script.Parent:WaitForChild('Humanoid')
RunAnim = script.Parent:WaitForChild('Animations'):WaitForChild('RunAnim')
RunAnimTrack = Humanoid:LoadAnimation(RunAnim)

Humanoid.Running:Connect(function(speed)
	--print(speed)
	if (speed > 1) then
		RunAnimTrack:Play()
	else
		RunAnimTrack:Stop()
	end
end)

It can be run as either a server Script or a LocalScript.
The animation plays and replicates when it is a server script.
The animation plays but does not replicate when it is a LocalScript.
This isn’t a good fix either because it overrides the fall animation.


@Scarious It’s an R15 with some parts welded to it. It uses a Humanoid object. The player’s character is set to that specific rig.

Pretty sure speed has to be 0 if I remember correctly

I think you should use remote events. It would be too much to explain here but you should watch this video. This video teaches you the basics of remote events, and also includes a tutorial on remote functions.

There’s no need to use RemoteEvents as animations can be loaded and played on the client, replicating to the server automatically.

What might be beneficial is just straight up loading+playing the animations on the server instead of on the client, I’m not really sure what’s causing this replication disparity in truth.

2 Likes

Did you use a LocalScript? A LocalScript will only fire things locally or only to the client. Either connect it with a RemoteServer or use a Script if that’s the case.

1 Like

Animations get replicated to server automatically when played in a local script.

2 Likes

Oh, ok. I didn’t know since I haven’t really done anything about animation so I’d assume that it was the same.

This might be a bit off of your original question but when you load up into studio you should be able to grab the “Animate” script from the character model in Workspace. This might not be exactly what you’re looking for but if you need an animation played, then it could help you out.

This was actually the stupidest thing ever.
I found what was causing the bug.

This was how I had the animation property.
Looks normal right?
image

Try to guess what the problem was

It was using HTTP and not HTTPS so Roblox didn’t trust it

1 Like

This is why you should use rbxassetid my friend.

1 Like