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.
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.
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)
@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.
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.
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.
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.