when i try to play an animation on an npc that i have stored inside of a viewport frame, it doesn’t play. the print statements print but the animation still refuses to play. what am i doing wrong?
local function setHorseAnims()
print("loaded animation") -- prints with no issue
local horseFrame = gui:WaitForChild("horse-frame")
local realHorse = horseFrame:FindFirstChild("horse")
local horseHumanoid = realHorse:FindFirstChildWhichIsA("Humanoid")
local animator = horseHumanoid:FindFirstChildWhichIsA("Animator")
local horseAnim = animator:LoadAnimation(script:WaitForChild("idle"))
horseAnim.Priority = Enum.AnimationPriority.Action
horseAnim.Looped = true
horseAnim:Play()
if horseAnim.IsPlaying then
print("playing") -- prints also
else
warn("not playing for some reason")
end
end
-- later in the script i call the function