To make NPC play animation in viewport frame you would need to insert WorldModel inside of viewport frame, and then parent NPC in WorldModel as well as set primary part of WorldModel to primary part of NPC, and then load your animation and play it, that should be solution for it, your code should look something like this:
local WorldModel = Instance.new("WorldModel")
WorldModel.Parent = ViewPortFrame -- define variable for viewport somewhere at top
char.Parent = WorldModel
WorldModel.PrimaryPart = char.PrimaryPart
local anim = hum:LoadAnimation(script.Animation)
anim.Looped = true
anim:Play()