I am currently making a game that includes an infection system, where when a player gets infected, their appearance will be replaced with a zombie appearance, with different character animations. However, my attempts to change the animations have been futile. I have tried directly changing the Animations’ ID values that are a part of the default character Animate script, but the engine does not recognize this change and proceeds to use the default character animations. I have also tried making my own modified version of the character Animate script with my own IDs in the script’s code itself, but then the animations don’t load at all and the player has no animation.
I have little to no experience with animations, so this is very confusing to me.
This is the article I was referencing when I was attempting to change the animations, however, the new animations would not load and it would just use the defaults.
The method referenced in that article, replacing the Animate script with your own modified version of it, does not work for me. When I tried it, the animations would not load and your character would slide around the ground with no animation.
Do players respawn when they are infected in your game? If not, were you using the code from the Change an Existing Character’s Animations section? I just tested the code from that section out on a baseplate, and it worked just fine for me.
Yes, I used the code from the Change an Existing Character’s Animations section, as the players do not respawn when infected, but the animations did not change and it stuck with the default animations.
This is the code I used:
local character = game.Workspace:WaitForChild(player)
local humanoid = character:WaitForChild("Humanoid")
local descriptionClone = humanoid:GetAppliedDescription()
descriptionClone.ClimbAnimation = 1113754738
descriptionClone.IdleAnimation = 1113752682
descriptionClone.RunAnimation = 1113750642
humanoid:ApplyDescription(descriptionClone)
I used this exact script in my game and it worked as intended. That being said, disabling player choice for animations rendered this unable to function.
It seems you can’t overwrite animations, even with HumanoidDescriptions, if you disable player choice for avatar animations.
Okay, I fixed this by manually downloading the animation files using a Chrome extension, inserting them into Studio, and putting them in the forked Animate script. I believe the issue here is that it wouldn’t grab the animations from the roblox site, as manually putting the animations in did the trick.