Animation not playing

Here is my code. Assets is a folder with animations, particle effects, sounds and models.

	local anim2 = humanoid:LoadAnimation(assets.animation)
	anim2:Play()
local character = script.Parent
local humanoid = character.Humanoid
local humanoidRootPart = character.HumanoidRootPart
local head = character.Head
local player = game.Players:GetPlayerFromCharacter(character)
local rightArm = character["Right Arm"]

This script is parented to the character once it spawns. Animation priority is ACTION and there is nothing else with the animation priority ACTION.

	
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:WaitForChild("Animator")

local anim2 = Animator:LoadAnimation(assets.animation)
anim2.Looped = true
anim2:Play()

Thanks but somehow it keeps on not working.

if that animation is published by you then you should check if assets.animation has AnimationId and if animation rig type matches your game rig type

I did both of those things at the start. Nothing seems to work.

is there any error in the output? if not, could you show full script it might help

If it’s a local script try this
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild(“Humanoid”)
local Animator = humanoid:WaitForChild(“Animator”)

local anim2 = Animator:LoadAnimation(assets.animation)
anim2:Play()

There is no error. However, I cannot share my whole script. I think I found the cause of the error. I am going to look at it. If I cant find it, I’ll share the script.

Make sure that the animation you are playing is uploaded to the same profile.

For example if the game place is in group then upload the animation in the group, If game place is published in your profile then upload the animation in your profile.

1 Like

Figured it out. ty for ur help