Animation not working on Custom Character!

Hello,

I made a custom animation for walking, idol, and jump for my custom starter character, however, none of them player on the character.

They work when its just the regular players avatar, just not a custom character.

local walkAnimationId = "rbxassetid://17759711806."
local idleAnimationId = "rbxassetid://17759708983."
local jumpAnimationId = "rbxassetid://17759710505."

local players = game:GetService("Players")

local function onCharacterAdded(character)
	local humanoid = character:WaitForChild("Humanoid")

	local animateScript = character:WaitForChild("Animate")

	animateScript.walk.WalkAnim.AnimationId = walkAnimationId
	animateScript.idle.Animation1.AnimationId = idleAnimationId
	animateScript.jump.JumpAnim.AnimationId = jumpAnimationId
end

local function onPlayerAdded(player)
	player.CharacterAppearanceLoaded:Connect(onCharacterAdded)
end

players.PlayerAdded:Connect(onPlayerAdded)

Yes, the starter character has extra parts but they are welded on correctly.

How come the animation doesn’t work for the custom player, but works on a regular avatar? someone please help.

Hi! I also shared the same problems as you did, for me I basically made a new Local script and put it into StarterCharacterScripts, so something like the following:

image

This greatly helped in terms of flexibility, so if I had more custom characters (all of them were R15), they all still played the correct animations. I haven’t really used the default Animate script since it was a bit troublesome, I found this approach much easier.

Then for each animation you have, you can put an animation Value, and refer to it in the script.

An example

local Player = game:GetService("Players").LocalPlayer

--Remote

local walkAnimation = script:WaitForChild("Run")
local idleAnimation = script:WaitForChild("Idle")
local crouchAnimation = script:WaitForChild("Crouch")
local jumpAnimation = script:WaitForChild("Jump")


local Character = Player.Character or Player.CharacterAdded
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")

local Walk = Humanoid:LoadAnimation(walkAnimation)
local Idle = Humanoid:LoadAnimation(idleAnimation)
local Crouch = Humanoid:LoadAnimation(crouchAnimation)
local Jump = Humanoid:LoadAnimation(jumpAnimation)

local isCrouching = false

Crouch.Looped = true
Crouch.Priority = Enum.AnimationPriority.Action

Jump.Looped = false
Idle.Looped = true

Idle:Play()

Humanoid.Running:Connect(function(movementSpeed)
	if movementSpeed > 0 then
		if not Walk.IsPlaying then
			Idle:Stop()
			Walk:Play()
		end
	else
		Walk:Stop()
		Idle:Play()
	end
end)

Humanoid.Jumping:Connect(function()
	Jump:Play()
end)

UserInputService.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.C then
		isCrouching = true
		Crouch:Play()
		Humanoid.WalkSpeed = 16
	end
end)

UserInputService.InputEnded:Connect(function(key)
	Crouch:Stop()
	isCrouching = false
	Humanoid.WalkSpeed = 30
end)

This is a basic outline of how I approached it, you can obviously change it as like. Hope this helps!