The problem is with this model. When I use an animation controller to make the FBX model animate, it works. But when I add a humanoid to it, it stops working. I need the humanoid to be there bc I want my character to become that model.
The one without the animation controller
local character = script.Parent
local humanoid = character:FindFirstChildOfClass("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local animationController = character:FindFirstChildOfClass("AnimationController")
if animationController then
animationController:Destroy()
end
if not animator then
animator = Instance.new("Animator")
animator.Parent = humanoid
end
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://104253519388280"
local animationTrack = animator:LoadAnimation(animation)
animationTrack:Play()
The one with it
local npcModel = game.Workspace.StarterCharacter
local animationController = npcModel:FindFirstChild("AnimationController")
animationController.Parent = npcModel
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=104253519388280" -- Roblox dance emote
local animationTrack = animationController:LoadAnimation(animation)
wait()
animationTrack:Play()