- What do you want to achieve?
I want to get my animation to play inside a viewport frame.
- What is the issue?
It’s rendering my character perfectly fine, but it’s just not playing my animation. There are no errors. This same exact script works perfectly fine on a dummy I created.
The viewport model is also playing it’s own idle animation but I cannot run mine. https://gyazo.com/eff83a95fcd964b94b95db9e11ea10c9
function showFirstPlaceAvatar(firstPlaceWinner)
local firstPlaceCharacter = game.Players:FindFirstChild(firstPlaceWinner).Character
firstPlaceCharacter.Archivable = true
avatarCharacterModel = Instance.new("WorldModel")
local characterClone = firstPlaceCharacter:Clone()
characterClone.Name = "characterClone"
characterClone.Parent = avatarCharacterModel
firstPlaceCharacter.Archivable = false
avatarCharacterModel.Parent = viewportUI
--viewportCamera.CFrame = CFrame.new(Vector3.new(0, 0, 20), clone:FindFirstChild("HumanoidRootPart").Position)
viewportCamera.CFrame = avatarCharacterModel.characterClone.Head.CFrame * CFrame.new(0,-1,-5) * CFrame.Angles(0, math.rad(180), 0)
local wave = Instance.new("Animation")
wave.AnimationId = "rbxassetid://7277849467"
local animator = characterClone.Humanoid.Animator
local animationTrack = animator:LoadAnimation(wave)
animationTrack:Play()
end
GUI Hierarchy
