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.
For reference, these are the animations I am trying to replace the default animations with:
If anyone can explain to me how to do this properly, it would be much appreciated.
You can use a HumanoidDescription to change animations for characters. Additionally, you can change other parts of the character as needed.
This should help you out a bit - (part of changing default animations is near the bottom) https://developer.roblox.com/articles/using-animations-in-games
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.
I just tried this method, however, it still loads the default animations instead of the different Werewolf ones I referenced in the post.
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.
Many topics on this exist already. Please search first and try all these solutions before you make a post.
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
I already have, and those solutions did not work for me, which is why I created this thread.
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.