I made a mesh animation for one of my monsters, but whenever I go in game It doesn’t show even in the studio. I’m thinking that the problem is the script.
local h = script.Parent:WaitForChild("Humanoid")
local a = h:LoadAnimation(script:FindFirstChildOfClass("Animation"))
a.Looped = true
a:Play()
I went on devforum to try and find a solution but I never found any answers. I also went on YouTube to find a solution too but it still doesn’t play the animation. Its my first time scripting and animating a mesh so I basically have no clue on how to make it work.
You don’t need a Humanoid if you have an AnimationController.
Place the AnimationController in the root of the model, and place an animator in the animation controller. User Animator:LoadAnimation() instead of Humanoid:LoadAnimation(). Your code should work if the animation was constructed properly.
I know this is a bit late, but make sure your character has AnimationContoroller and that it’s placed in the character’s root part. Then add Animator inside of the AnimationController, (manually or with server script). It’s ok to have a humanoid too in your character.
Then in the local script do (for example):
local char = game.Players.LocalPlayer.Character
local walk = --(find your animation here)
local animator = char:WaitForChild("HumanoidRootPart").AnimationController.Animator
local walkAnim = animator:LoadAnimation(walk)
walkAnim:Play()