Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I play an animation on an NPC inside of a ViewportFrame?

Asked by 4 years ago

I have an NPC inside of a ViewportFrame that I want to animate when you interact with it. The NPC is not anchored, and I've made sure my script works by using prints and I receive no errors.

Button.Activated:Connect(function()
    if not buttonActivated then
        local animation = Button.ViewportFrame.NPC.Humanoid:LoadAnimation(Button.Idle)
        animation:Play()
    end
end)

Answer this question