Roblox Documentation Animation Script Isn't Working

Hey! I made a walk/run animation for my custom character model, but whenever I try to use the Roblox’s Documentation script to change the animation IDs within the character, it doesn’t work. Whenever I check my character’s animation IDs (in game) under the script called “Animate” (the script that makes the animtions work), its just the default animations. Here is the link to the documentation: Using Animations | Roblox Creator Documentation.
If you cannot access the documentation right now, here is the default script that it gives you:

local Players = game:GetService("Players")

local function onCharacterAdded(character)
	-- Get animator on humanoid
	local humanoid = character:WaitForChild("Humanoid")
	local animator = humanoid:WaitForChild("Animator")

	-- Stop all animation tracks
	for _, playingTrack in pairs(animator:GetPlayingAnimationTracks()) do

	local animateScript = character:WaitForChild("Animate") = "rbxassetid://656118852"
	--animateScript.walk.WalkAnim.AnimationId = "rbxassetid://"
	--animateScript.jump.JumpAnim.AnimationId = "rbxassetid://"
	--animateScript.idle.Animation1.AnimationId = "rbxassetid://"
	--animateScript.idle.Animation2.AnimationId = "rbxassetid://"
	--animateScript.fall.FallAnim.AnimationId = "rbxassetid://"
	--animateScript.swim.Swim.AnimationId = "rbxassetid://"
	--animateScript.swimidle.SwimIdle.AnimationId = "rbxassetid://"
	--animateScript.climb.ClimbAnim.AnimationId = "rbxassetid://"

local function onPlayerAdded(player)


The script just stops and doesn’t run the onCharacterAdded function at from what I can tell. There are no errors too. I don’t know why this is happenening, and I probably can’t mend it. I tried to do my best, but I can’t seem to fix it. Thanks!

Since you are using a custom character you have to do some other things.

First you need to get a copy the Animate script from a working player, while it is in Play mode in studio.

For fun I made a copy of your Avatar, and put it in StarterPlayer, named exactly as StarterCharacter, so now I have a custom character. (You can also just Run the game, and in Play mode, copy your character, then stop, then paste it into the Workspace)

then do a CTRL Shift V, and paste it into the Workspace, then delete all the stuff under the Animate script (this stuff will get rebuilt when the game runs later)

Then rename it exactly as StarterCharacter, and move it right under StarterPlayer, there should be nothing under the script Animate

Then edit the Animate script and change the ids to what you want it to be.

In this example, 656118852 , the Ninja run.

Then move the Animate script into StarterCharacterScripts

Then Play, and enjoy the magic!

Doesnt work :(((((
It just resets the script when it loads in

what? Do you mean if you die? or what? Did you get rid of your original script?

I think I got it hold on and let me tell you…

I just reset my character and it still works.

Ok I know whats wrong:

  1. The walk animation ID is reset when I load into the experience.

  2. Your method doesn’t work because Roblox force resets the animation script and all of the contents within it.

  3. When I talk about the walk animation ID, I mean the stuff that you deleted that was inside of the Animate script. If you go over to WalkAnim and the value within it, you would see the ID needed. I know this is whats wrong because I manually put the ID in game to that value and the animaiton played.

If you know how to fix please do!

What? I have reset, also killed myself and it still works.

I am using a custom rig; Not a player. For some reason those aren’t the same

How are you loading your custom rig into the player?

I don’t understand what you mean. I have a custom rigged custom character that is renamed to StarterCharacter that is placed in StarterPack. It uses parts and is not in the shape of a normal player.