Hello,
I’m trying to add a feature in my game that at the end of the round, it shows the winner’s character doing a dance in a viewportFrame. The cloth loading works properly, but for some reason, the dance animation doesn’t play.
local viewportFrame = script.Parent.ViewportFrame
local len = viewportFrame.AbsoluteSize.X/2
local DumDum = script.Check1:Clone()
DumDum.PrimaryPart = DumDum.HumanoidRootPart
DumDum.Parent = viewportFrame.world
The following is another part of the script:
local Dance = GetCloth:InvokeServer('Dance','player_' .. pleyer.UserId) or 'rbxassetid://6129637854'
local DumHum = DumDum.Humanoid
local danceAnimation = Instance.new("Animation")
danceAnimation.AnimationId = Dance
local danceAnimationTrack = DumHum:LoadAnimation(danceAnimation)
danceAnimationTrack:Play()
I heard that Humanoid:LoadAnimation() was deprecated, so I replaced it with an ‘Animator’ and it still didn’t work. I tried putting the dummy in a world in the viewportFrame, but after that only the head and lowertorso animations play. I am certain that the animations are published correctly and the ids are right, as it partially works when I put it in a ‘worldModel’
Does anyone know why this doesn’t work properly?
Thanks,