You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I’d like my custom animations to work on ALL players.
- What is the issue? Include screenshots / videos if possible!
The animations run and look great on my character, but when my friend joins my game the animations don’t work. I have a custom walk/run, jump among others - when my friend joins my game he can walk but his legs don’t animate. He can attack and fight but only his idle animation is playing and the block animation does nothing as well. I’m not sure what to do or show on the forum as the code and animations work - just not on my friend’s character. (I haven’t tested other player accounts yet but all players should get the default animations.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried reuploading the animations. I tried changing different levels of ActionPriority to higher priorities. I’ve also been searching through my code… this almost seems like the animations are being given to player #1 but then there aren’t any left for the other players. I might need to do some cloning but I didn’t think I had to when assigning AnimationId only.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Here’s a chunk of code, it’s on the server and is ran when players join. It’s job is to set the default run, jump and fall animations for every player. Please let me know if something obvious is off, thanks!
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
for _, track in pairs(animator:GetPlayingAnimationTracks()) do
track:Stop(0)
end
local animScript = character:WaitForChild("Animate")
-- player animations go here --
animScript.jump.JumpAnim.AnimationId = script:WaitForChild("JumpAnim").AnimationId
animScript.run.RunAnim.AnimationId = script:WaitForChild("RunAnim").AnimationId
local load = animator:LoadAnimation(script:WaitForChild("FallAnim"):Clone()) -- I added clone here but it didn't seem to matter
load.Priority = Enum.AnimationPriority.Action
load.Looped = true
local delaytime = 0.5
local start
-- Falling animation is swapped out 1/2 a second after falling
hum.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.Freefall then
start = tick()
task.delay(delaytime, function()
if tick() - start >= delaytime and hum:GetState() == Enum.HumanoidStateType.Freefall then
load:Play()
end
end)
elseif hum:GetState() ~= Enum.HumanoidStateType.Freefall then
load:Stop()
end
end)
end)
end)